{"id":16993319,"url":"https://github.com/janloebel/simplest-mock-server","last_synced_at":"2026-02-10T09:35:57.258Z","repository":{"id":30944822,"uuid":"126457627","full_name":"JanLoebel/simplest-mock-server","owner":"JanLoebel","description":"This is a very simple mock server. Simplify returning static data on http requests.","archived":false,"fork":false,"pushed_at":"2024-12-20T06:56:38.000Z","size":642,"stargazers_count":1,"open_issues_count":14,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T13:16:16.887Z","etag":null,"topics":["http","mock","server","simple"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/JanLoebel.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":"2018-03-23T08:45:55.000Z","updated_at":"2020-04-01T12:52:51.000Z","dependencies_parsed_at":"2024-10-28T13:23:54.400Z","dependency_job_id":"e5fe02a5-90bb-4fd2-abac-476f92640b34","html_url":"https://github.com/JanLoebel/simplest-mock-server","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/JanLoebel%2Fsimplest-mock-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanLoebel%2Fsimplest-mock-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanLoebel%2Fsimplest-mock-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanLoebel%2Fsimplest-mock-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JanLoebel","download_url":"https://codeload.github.com/JanLoebel/simplest-mock-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244978517,"owners_count":20541866,"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":["http","mock","server","simple"],"created_at":"2024-10-14T03:42:51.698Z","updated_at":"2026-02-10T09:35:52.237Z","avatar_url":"https://github.com/JanLoebel.png","language":"JavaScript","readme":"# Simplest Mock Server\r\n[![Build Status](https://travis-ci.org/JanLoebel/simplest-mock-server.svg?branch=master)](https://travis-ci.org/JanLoebel/simplest-mock-server)\r\n\r\nThis is a very simple mock server. Simplify returning static data on http requests.\r\n\r\nIt supports returning different static files requested with a specific url, method or query-parameters.\r\n\r\nReturn mock data specified by:\r\n\r\n* url (e.g.: `/customer` )\r\n* method (e.g.: `GET`, `POST`)\r\n* query-parameter (e.g.: `?page=2\u0026sort=name,desc`)\r\n\r\n## Using the server\r\n\r\n1.  Navigate into your MagicMirror's modules folder and execute `git clone https://github.com/JanLoebel/simplest-mock-server.git`\r\n2.  Execute `cd simplest-mock-server` \u0026\u0026 `npm install` to install the node dependencies\r\n3.  Start the server by executing `npm run watch`\r\n4.  Configure the routes depending on your needs. Therefore open the `config.js`\r\n\r\n```js\r\nmodule.exports = {\r\n  server: {\r\n    port: 3000\r\n  },\r\n  mocks: [\r\n    {\r\n      path: \"/test\",\r\n      query: \"a=true\u0026b=false\u0026c=1\",\r\n      responseFile: \"./responseFiles/test1.txt\",\r\n    },\r\n    {\r\n      path: \"/test/2\",\r\n      responseFile: \"./responseFiles/test2.json\"\r\n      method: \"POST\",\r\n      responseCode: 200\r\n    }\r\n  ];\r\n}\r\n```\r\n\r\n## Running the tests\r\n\r\nSimplest Mock Server comes bundled with a [Postman](https://www.getpostman.com/) Collection containing some tests to verify everything is working.  \r\nIt is run using [Newman](https://www.getpostman.com/docs/postman/collection_runs/command_line_integration_with_newman). These tests are based on the default response files.\r\n\r\nRun the tests with:\r\n```\r\nnpm test\r\n```\r\n\r\n## Configuration options\r\n\r\n| Option   | Description                                                                                        |\r\n| -------- | -------------------------------------------------------------------------------------------------- |\r\n| `server` | _Required_ Server configuration, see `Server configuration options`.\u003cbr\u003e\u003cbr\u003e**Type:** `object`\u003cbr\u003e |\r\n| `mocks`  | _Required_ Array of mocks, see `Mock configuration options`.\u003cbr\u003e\u003cbr\u003e**Type:** `array`\u003cbr\u003e          |\r\n\r\n### Server configuration options\r\n\r\n| Option | Description                                                               |\r\n| ------ | ------------------------------------------------------------------------- |\r\n| `port` | _Optional_ Server port to listen.\u003cbr\u003e\u003cbr\u003e**Type:** `int`\u003cbr\u003eDefault: 3000 |\r\n\r\n### Mock configuration options\r\n\r\n| Option         | Description                                                                             |\r\n| -------------- | --------------------------------------------------------------------------------------- |\r\n| `path`         | _Required_ Path to listen for requests.\u003cbr\u003e\u003cbr\u003e**Type:** `string`\u003cbr\u003e                   |\r\n| `method`       | _Optional_ HTTP-Method to listen for.\u003cbr\u003e\u003cbr\u003e**Type:** `string`\u003cbr\u003e Default: `GET`      |\r\n| `query`        | _Optional_ Query-String to match, order is not important.\u003cbr\u003e\u003cbr\u003e**Type:** `string`\u003cbr\u003e |\r\n| `responseFile` | _Optional_ Location for the file to return.\u003cbr\u003e\u003cbr\u003e**Type:** `string`\u003cbr\u003e               |\r\n| `responseCode` | _Optional_ Response-Code to return. \u003cbr\u003e\u003cbr\u003e**Type:** `int` \u003cbr\u003eDefault: 200            |\r\n\r\n## Contribution\r\n\r\nPlease feel free to improve or modify the code and send a Pull-Request! Any contribution is very welcome :)\r\n\r\n## The MIT License (MIT)\r\n\r\nCopyright © 2018 Jan Loebel\r\n\r\nPermission is hereby granted, free of charge, to any person\r\nobtaining a copy of this software and associated documentation\r\nfiles (the “Software”), to deal in the Software without\r\nrestriction, including without limitation the rights to use,\r\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the\r\nSoftware is furnished to do so, subject to the following\r\nconditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\n**The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.**\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanloebel%2Fsimplest-mock-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanloebel%2Fsimplest-mock-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanloebel%2Fsimplest-mock-server/lists"}