{"id":17231817,"url":"https://github.com/pierreprinetti/apimock","last_synced_at":"2025-03-17T11:30:31.747Z","repository":{"id":74417584,"uuid":"64232790","full_name":"pierreprinetti/apimock","owner":"pierreprinetti","description":"A mock API server.","archived":false,"fork":false,"pushed_at":"2020-07-09T10:08:09.000Z","size":51,"stargazers_count":119,"open_issues_count":0,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-08T16:48:41.551Z","etag":null,"topics":["devtool","mock-server"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/pierreprinetti/apimock/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pierreprinetti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-26T15:30:39.000Z","updated_at":"2024-01-10T13:01:57.000Z","dependencies_parsed_at":"2024-06-20T13:05:26.406Z","dependency_job_id":"2c651187-f531-471c-ac54-67778f74008c","html_url":"https://github.com/pierreprinetti/apimock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreprinetti%2Fapimock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreprinetti%2Fapimock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreprinetti%2Fapimock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierreprinetti%2Fapimock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pierreprinetti","download_url":"https://codeload.github.com/pierreprinetti/apimock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858056,"owners_count":20359271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devtool","mock-server"],"created_at":"2024-10-15T04:59:01.913Z","updated_at":"2025-03-17T11:30:31.378Z","avatar_url":"https://github.com/pierreprinetti.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apimock\n[![Go Report Card](https://goreportcard.com/badge/github.com/pierreprinetti/apimock)](https://goreportcard.com/report/github.com/pierreprinetti/apimock)\n[![Build Status](https://travis-ci.org/pierreprinetti/apimock.svg?branch=master)](https://travis-ci.org/pierreprinetti/apimock)\n\nThis is a very basic fake API server. I use it to build the front-end of web applications, without the need for the backend to be ready.\n\nIt is an in-memory, non-persistent key-value store you can fill with `PUT` requests, where the request path is the key and the request body is the value.\nRetrieve the saved value with a subsequent `GET` request at the same endpoint.\n\n_apimock_ will serve back the same `Content-Type` is has received. If no `Content-Type` header was sent with the `PUT` request, the `DEFAULT_CONTENT_TYPE` environment variable will be sent.\n\n_apimock_ is meant for prototyping. **Please do NOT use it in production**.\n\n## Example:\n\n    $ HOST=localhost:8800 apimock \u0026\n    $ curl -X PUT -d '{\"message\": \"This is not a pipe\"}' localhost:8800/my/endpoint\n    \u003e {\"message\": \"This is not a pipe\"}\n    $ curl -X GET localhost:8800/my/endpoint\n    \u003e {\"message\": \"This is not a pipe\"}\n    $ curl -X DELETE localhost:8800/my/endpoint\n    $ curl -X GET localhost:8800/my/endpoint\n    $\n\n## Content-Type\nApimock will remember the `Content-Type` associated with every request. This behaviour can be modified with the environment variables:\n\n- `DEFAULT_CONTENT_TYPE`: When the `PUT` request doesn't bear a `Content-Type`, this one will be used. If not specified, this is `text/plain`.\n- `FORCED_CONTENT_TYPE`: The specified string will be used as `Content-Type` no matter what is transmitted with the `PUT` request.\n\n## Docker container\n\n    docker run --name apimock -p 8800:8800 -d pierreprinetti/apimock:latest\n\n## Features\n\nIt currently supports:\n- [x] CORS headers (responses always bear `Allow-Origin: *` and a bunch of authorized headers and methods)\n- [x] `OPTIONS`\n- [x] `PUT`\n- [x] `GET`\n- [x] `DELETE`\n- [x] `Content-Type` header\n\nWhat it might support in the future:\n- [ ] `POST` to an endpoint with fake ID generator (e.g. `POST` to `example.com/items` would result in the storage of the element in `example.com/items/1`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierreprinetti%2Fapimock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierreprinetti%2Fapimock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierreprinetti%2Fapimock/lists"}