{"id":16538555,"url":"https://github.com/potapovdim/json-fake-server","last_synced_at":"2025-03-16T19:32:01.339Z","repository":{"id":54760863,"uuid":"100241802","full_name":"potapovDim/json-fake-server","owner":"potapovDim","description":"Simple way to create http server (node js) https://www.npmjs.com/package/test-fake-server","archived":false,"fork":false,"pushed_at":"2024-08-27T13:55:15.000Z","size":497,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-12T18:46:00.726Z","etag":null,"topics":["api","backend-server","fake-server","mock","mock-server","nodejs","rest-api","static-server"],"latest_commit_sha":null,"homepage":"","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/potapovDim.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-08-14T07:46:59.000Z","updated_at":"2024-08-27T13:55:19.000Z","dependencies_parsed_at":"2022-08-14T02:00:52.815Z","dependency_job_id":"bf53cbc1-89c3-4d20-bbc3-2f3ca516514e","html_url":"https://github.com/potapovDim/json-fake-server","commit_stats":{"total_commits":150,"total_committers":2,"mean_commits":75.0,"dds":"0.013333333333333308","last_synced_commit":"ff2c3881a91e41ecaa42168f0ac8c11e381c01f9"},"previous_names":["potapovdim/mock-backend-rest"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potapovDim%2Fjson-fake-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potapovDim%2Fjson-fake-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potapovDim%2Fjson-fake-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potapovDim%2Fjson-fake-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potapovDim","download_url":"https://codeload.github.com/potapovDim/json-fake-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221667358,"owners_count":16860607,"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":["api","backend-server","fake-server","mock","mock-server","nodejs","rest-api","static-server"],"created_at":"2024-10-11T18:45:59.089Z","updated_at":"2025-03-16T19:32:01.330Z","avatar_url":"https://github.com/potapovDim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage\n\n* Build simple fake server with routing, params, static content\n* GET, POST, PUT, DELETE, supported methods, status, bodies etc\n\n![npm downloads](https://img.shields.io/npm/dm/test-fake-server.svg?style=flat-square)\n\n## Install\n```sh\nnpm install -SD test-fake-server || npm i -g test-fake-server\n```\n\n## Example\nbase usage example\n```js\nconst fakeServer = require('test-fake-server')\nconst model = {\n  port: 9090,\n  api: [{\n    method: \"GET\",\n    path: \"/\",\n    response: \"Hello world\"\n  }]\n}\nfakeServer(model).then((server) =\u003e {\n  setTimeout(() =\u003e {\n    server.stop()\n  }, 25000)\n})\n// open browser\n// url 'http://localhost:9090/\n```\n\nmocha test example\n```js\nconst fakeServer = require('test-fake-server')\n\nconst {expect} = require('chai')\n\nconst model = {\n  \"port\": 8888,\n  \"api\": [\n    {\n      \"method\": \"GET\",\n      \"path\": \"/user\",\n      \"response\": {\n        \"user_name\": \"test user\"\n      }\n    },\n    {\n      \"method\": \"POST\",\n      \"path\": \"/user\",\n      \"response\": {\"created\": true}\n    }\n  ]\n}\n\ndescribe('Example', () =\u003e {\n  let server = null\n  beforeEach(async () =\u003e {\n    server = await fakeServer(model)\n  })\n  after(async () =\u003e {\n    await server.stop()\n  })\n  it('test post user', async function() {\n    const responseBody = await fetch('http://localhost:8888/user', {method: 'POST'}).then((res) =\u003e res.json())\n    expect(responseBody.created).to.eql(true)\n  })\n  it('test get user', async function ()  {\n    const responseBody = await fetch('http://localhost:8888/user').then((res) =\u003e res.json())\n    expect(responseBody.user_name).to.eql('test user')\n  })\n})\n```\n\n## Example from command line\n./test.json\n```json\n{\n  \"port\": 8081,\n  \"host\": \"0.0.0.0\",\n  \"api\": [\n    {\n      \"method\": \"GET\",\n      \"path\": \"/example\",\n      \"response\": {\n        \"example\": \"example GET\"\n      }\n    }\n  ]\n}\n```\n\n```sh\ntest-fake-server -m ./test.json\n```\n\n[More examples](https://github.com/potapovDim/test-fake-server/tree/new_approach/examples)\n\n\n## Model Structure\n\n- [Endpoint Model Object](#model-object)\n- [HTTP methods](#http-method)\n- [Authorization](#authorization)\n- [Url params](#params)\n- [Queries](#queries)\n- [HTML static](#html)\n- [Request body assertion](#request-body-assertion)\n- [Several server nodes in one environment](#several-server-nodes-in-one-environment)\n\n\n## Endpoint Model Object\n\n```js\nconst APIModelObject =   {\n  \"method\": \"GET\",                    // required field, http methods: GET, POST, PUT, DELETE\n  \"path\": \"/example/:param1/:param2\", // required field, params can be presented here\n  \"status\": 200,                      // status in option field, default is 200\n\n   \"authorization\":{                  // if full server model inludes authorization property, this will take part\n                                      // in our endpoint response\n    \"unauthorized\": {                 // this property will be used as body for respose if request does not have credentials,\n                                      // unauthorized is optional, default is {unauthorized: 'unauthorized'}\n      \"foo\": \"bar\"\n    },                                // status what will be used, it is optional, default is 401\n    \"status\": 401,                    //\n    \"token\":\"testToken\"               //\n  },\n\n  \"params_response\": {                // params_response is optional, it required if you want to work with\n    \"response\": {                     // properties of this object shoulb be equal params declaration in url\n        \"allParamsAreEqual\": {        // for example our path is \"/example/:param1/:param2\"\n          \"param1\": \"success\",        // params_response object includes properties : param1 and param2\n          \"param2\": \"success\"         // object param should have propertie \"value\" what will uses as a assertion\n        }                             // for example  curl http://localhost:8888/example/testFirst/someItemWhatNotExists\n    },                                // response will be from param1 object - { \"testId\": \"testFirst\" }\n    \"param1\": {                       // if all params value equal our request url params we will get general response\n      \"status\": 201,                  // in case if custom status code is required put it in param object\n      \"value\": \"testFirst\",           // from params_response object or it it is not exists\n      \"response\": {                   // responses from params objects will be merged\n          \"testId\": \"testFirst\"\n    },\n    \"param2\": [{                      // in case if response should depends on request param you can use array\n      \"value\": \"testSecondSuccess\",   // if /example/some/testSecondSuccess response will be next and status code 200\n      \"status\": 200,\n      \"response\": {\n          \"testId\": \"testSecond\"\n      }\n    },\n    {\n      \"value\": \"testSecondFailed\",   //  if /example/some/testSecondFailed response will be \"Not found\" and status code 401\n      \"status\": 401\n      \"response\": \"Not found\"\n    }]\n  },\n  \"request_body_equal\": {             // this property will work with PUT, POST, DELETE, PATCH only\n    \"allow_partial_request_body\": true, // allow send not all keys and get success response\n    \"status\": 404,\n    \"not_equal_response\": {         // this field is optional, default is {\"data\": \"invalid request\"}\n       \"success\": false\n    },\n    \"expected_body\": {              // request body should equal expected_body property\n      \"username\": \"test\",\n      \"password\": \"test_pass\"\n    }\n  },\n  \"response\": {                       // response is option field, default is {ok: 'OK'}\n    \"example\": \"example GET\"\n  },\n}\n```\n\n## HTTP methods\n```js\nconst fakeServer = require('test-fake-server')\n\nconst model =\n{\n  \"port\": 8081,\n  \"api\": [\n    {\n      \"method\": \"GET\",\n      \"path\": \"/example\",\n      \"response\": {\n        \"example\": \"example GET\"\n      }\n    },\n    {\n      \"method\": \"POST\",\n      \"path\": \"/example\",\n      \"response\": {\n        \"example\": \"example POST\"\n      }\n    },\n    {\n      \"method\": \"DELETE\",\n      \"path\": \"/example\",\n      \"response\": {\n        \"example\": \"example DELETE\"\n      }\n    },\n    {\n      \"method\": \"PUT\",\n      \"path\": \"/example\",\n      \"response\": {\n        \"example\": \"example PUT\"\n      }\n    }\n  ]\n}\n\n\nasync function callToServer() {\n  const server = await fakeServer(model)\n  const postData = await fetch('http://localhost:8888/example', {method: 'POST'}).then((res) =\u003e res.json())\n  // {example: \"example POST\"}\n  const getData = await fetch('http://localhost:8888/example', {method: 'GET'}).then((res) =\u003e res.json())\n  // {example: \"example GET\"}\n  const putData = await fetch('http://localhost:8888/example', {method: 'PUT'}).then((res) =\u003e res.json())\n  // {example: \"example PUT\"}\n  const deleteData = await fetch('http://localhost:8888/example', {method: 'DELETE'}).then((res) =\u003e res.json())\n  // {example: \"example DELETE\"}\n}\n```\n\u003cimg src=\"./misc/get_example.png\"\u003e\n\n## Authorization\n\n```js\nconst fakeServer = require('test-fake-server')\n\n\nconst authorizationInApiObj = {\n        \"unauthorized\": {   // this property will be used as body for respose\n          \"foo\": \"bar\"      //\n        },                  //\n        \"status\": 401,      // this property will be used as unsuccess status if token is not equal\n        \"token\":\"testToken\" // to this toke property value\n      }\n\nconst model = {\n  \"port\": 8081,\n  \"authorization\": {\"type\": \"headers\"},\n  \"api\": [\n    {\n      \"method\": \"GET\",\n      \"path\": \"/example\",\n      \"response\": {\"example\": \"example GET\"},\n      // default properties are\n      // unauthorized : {unauthorized: 'unauthorized'}\n      // status : 401\n      \"authorization\": authorizationInApiObj\n    }\n  ]\n}\n\nasync function callToServerHeaderAuthorization() {\n  const server = await fakeServer(model)\n  const withoutTokenData = await fetch('http://localhost:8888/example', {method: 'GET'}).then((res) =\u003e res.json())\n  // {foo: \"bar\"}\n  const withTokenData = await fetch('http://localhost:8888/example', {\n    headers: {Authorization: 'Bearer testToken'},\n    method: 'GET'}).then((res) =\u003e res.json())\n  // {example: \"example GET\"}\n}\ncallToServerHeaderAuthorization()\n```\n\n\u003cimg src=\"./misc/autiruzation.png\"\u003e\n\n## Params\n\n```js\nconst fakeServer = require('test-fake-server')\n\n\nconst model = {\n  \"port\": \"8081\",\n  \"api\": [{\n    \"method\": \"GET\",\n    // after : name of param shoulb be used in params_response object\n    // lets check :user\n    \"path\": \"/user/:user/id/:id\",\n\n    \"params_response\": {\n      \"id\": {\n        \"value\": \"testId\",\n        \"response\": {\n          \"testId\": \"testId\"\n        }\n      },\n      // user\n      // if user will contain /user/testUser/id/:id\n      // we will get next response from user object\n      \"user\": {\n        \"value\": \"testUser\",\n        \"response\": {\n          \"user\": \"testId\"\n        }\n      },\n\n      // if we have full uquals between params\n      // we will get general response - response property from params_response object\n      // in this case we heed\n      // http://localhost:8081/user/testUser/id/testId\n      \"response\": {\n        \"full_params_equal\": {\n          \"username\": \"test user1\",\n          \"password\": \"test password\"\n        }\n      }\n    },\n    // this response will be used in other cases\n    // as example http://localhost:8081/user/unknown/id/unknown\n    \"response\": {\n      \"example\": \"example GET\"\n    }\n  }]\n}\nasync function callToServer() {\n  const server = await fakeServer(model)\n  const defaultGetData = await fetch('http://localhost:8081/user/unknown/id/unknown', {method: 'GET'}).then((res) =\u003e res.text())\n  // {\"example\": \"example GET\"}\n  console.log(defaultGetData)\n\n  const fullPramsEqual = await fetch('http://localhost:8081/user/testUser/id/testId', {method: 'GET'}).then((res) =\u003e res.text())\n  // {\"full_params_equal\": {\n  //   \"username\": \"test user1\",\n  //   \"password\": \"test password\"\n  // }}\n  console.log(fullPramsEqual)\n\n  const userEqualParamEqual = await fetch('http://localhost:8081/user/testUser/id/unknown', {method: 'GET'}).then((res) =\u003e res.text())\n  // {\"user\": \"testId\"}\n  console.log(userEqualParamEqual)\n\n  const idEqualParamEqual = await fetch('http://localhost:8081/user/unknown/id/testId', {method: 'GET'}).then((res) =\u003e res.text())\n  // {\"testId\": \"testId\"}\n  console.log(idEqualParamEqual)\n}\n\ncallToServer()\n\n```\n\u003cbr /\u003e\nDefault response\n\u003cbr /\u003e\n\u003cimg src=\"./misc/params_default.png\"\u003e\n\u003cbr /\u003e\nFull params equal response\n\u003cbr /\u003e\n\u003cimg src=\"./misc/params_full_equal.png\"\u003e\n\u003cbr /\u003e\nPartial equal param user\n\u003cbr /\u003e\n\u003cimg src=\"./misc/params_partial_equal_user.png\"\u003e\n\u003cbr /\u003e\nPartial equal param id\n\u003cbr /\u003e\n\u003cimg src=\"./misc/params_partial_equal_id.png\"\u003e\n\u003cbr /\u003e\n\n\n## Queries\n```js\nconst fakeServer = require('../')\n\n\nconst model_obj = {\n  \"port\": \"8081\",\n  \"api\": [{\n    \"method\": \"GET\",\n    \"path\": \"/test\",\n    \"response\": {\n      \"testOne\": 1,\n      \"testTwo\": 2,\n      \"testThree\": 3,\n      \"testFour\": 4,\n    }\n  }]\n}\n\nconst model_array = {\n  \"port\": \"8082\",\n  \"api\": [{\n    \"method\": \"GET\",\n    \"path\": \"/test\",\n    \"response\": [\n      {\n        \"testOne\": 1,\n        \"testTwo\": 2,\n        \"testThree\": 3,\n        \"testFour\": 4,\n      },\n      {\n        \"testOne\": 1,\n        \"testTwo\": 2,\n        \"testThree\": 3,\n        \"testFour\": 4,\n      },\n      {\n        \"testOne\": 1,\n        \"testTwo\": 2,\n        \"testThree\": 3,\n        \"testFour\": 4,\n      }\n    ]\n  }]\n}\n\nasync function callToServer() {\n\n  server_obj = await  fakeServer(model_obj)\n  server_array = await fakeServer(model_array)\n\n  const query_resp_obj = await fetch('http://localhost:8081/test?testOne=1\u0026testTwo=2', {method: 'GET'}).then((res) =\u003e res.text())\n  // {\"testOne\":1,\"testTwo\":2}\n  console.log(query_resp_obj)\n\n  const query_resp_array = await fetch('http://localhost:8082/test?testOne=1\u0026testTwo=2', {method: 'GET'}).then((res) =\u003e res.text())\n  // [{\"testOne\":1,\"testTwo\":2},{\"testOne\":1,\"testTwo\":2},{\"testOne\":1,\"testTwo\":2}]\n  console.log(query_resp_array)\n  await server_obj.stop()\n  await server_array.stop()\n}\n```\n\n## HTML\n\n```js\nconst fakeServer = require('test-fake-server')\n\nconst path = require('path')\n\nconst indexHtml = path.resolve(__dirname, './index.html')\nconst model = {\n  \"port\": \"8081\",\n  \"api\": [{\n    \"method\": \"GET\",\n    \"path\": \"/\",\n    \"response\": indexHtml\n  }]\n}\nasync function callToServer() {\n  const server = await fakeServer(model)\nconst indexHtmlText = await fetch('http://localhost:8081/', {method: 'GET'}).then((res) =\u003e res.text())\n  // \u003chtml lang=\"en\"\u003e\n  //   \u003chead\u003e\n  //     \u003cmeta charset=\"UTF-8\"\u003e\n  //     \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  //     \u003cmeta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\"\u003e\n  //     \u003ctitle\u003eDocument\u003c/title\u003e\n  //   \u003c/head\u003e\n  //   \u003cbody\u003e\n  //     TEST FAKE SERVER\n  //     \u003cdiv\u003eA\u003c/div\u003e\n  //     \u003cdiv\u003eB\u003c/div\u003e\n  //     \u003cdiv\u003eC\u003c/div\u003e\n  //     \u003cdiv\u003eD\u003c/div\u003e\n  //     \u003cdiv\u003eE\u003c/div\u003e\n  //   \u003c/body\u003e\n  //   \u003c/html\u003e\n  console.log(indexHtmlText)\n  await server.stop()\n}\n\n```\n\u003cimg src=\"./misc/html.png\"\u003e\n\n## Request body assertion\n```js\nconst fakeServer = require('test-fake-server')\n\n\n// full equalty check\nasync function callToServer() {\n  const model_obj = {\n  \"port\": \"8081\",\n  \"debug\": true, // if this prop exists log will show all results in console, defailt is false\n  \"api\": [{\n    \"method\": \"POST\",\n    \"path\": \"/test\",\n    \"request_body_equal\": {\n      \"status\": 404,\n      \"not_equal_response\": { // this field is optional, default is {\"data\": \"invalid request\"}\n         \"success\": false\n      },\n      \"expected_body\": {\n        \"username\": \"test_\",\n        \"password\": \"test_pass\"\n      }\n    },\n    \"response\": {\n      \"success\": true\n    }\n    }]\n  }\n\n  const serser = await fakeServer(model_obj)\n\n  const body_equal_success = await fetch('http://localhost:8081/test', {\n    method: 'POST',\n    headers: {'Content-Type': 'application/json'},\n    body: JSON.stringify({\"username\": \"test_\", \"password\": \"test_pass\"})\n  }).then((res) =\u003e res.text())\n  // {\"success\":true}\n  console.log(body_equal_success)\n\n  const body_not_equal = await fetch('http://localhost:8081/test', {\n    method: 'POST',\n    headers: {'Content-Type': 'application/json'},\n    body: JSON.stringify({\n      \"username\": \"test_1\",\n      \"password\": \"test_pass\"\n    })\n  }).then((res) =\u003e res.text())\n  // {\"success\": false}\n  console.log(body_not_equal)\n  await serser.stop()\n}\n\nasync function callToServerPartialRequest() {\n  const model_obj = {\n    \"port\": \"8081\",\n    \"debug\": true, // if this prop exists log will show all results in console, defailt is false\n    \"api\": [{\n      \"method\": \"POST\",\n      \"path\": \"/user\",\n      \"request_body_equal\": {\n        \"status\": 404,\n        \"not_equal_response\": { // this field is optional, default is {\"data\": \"invalid request\"}\n          \"success\": false\n        },\n        \"allow_partial_request_body\": true,\n        \"expected_body\": {\n          \"username\": \"test_\",\n          \"password\": \"test_pass\"\n        }\n      },\n      \"response\": {\n        \"success\": true\n      }\n    }]\n  }\n\n  const serser = await fakeServer(model_obj)\n\n  const body_equal_success = await fetch('http://localhost:8081/test', {\n    method: 'POST',\n    headers: {'Content-Type': 'application/json'},\n    body: JSON.stringify({\"username\": \"test_\",}) // partial body matches\n  }).then((res) =\u003e res.text())\n  // {\"success\":true}\n  console.log(body_equal_success)\n\n  const body_not_equal = await fetch('http://localhost:8081/test', {\n    method: 'POST',\n    headers: {'Content-Type': 'application/json'},\n    body: JSON.stringify({\n      \"username\": \"test_1\",\n      \"password\": \"test_pass\"\n    })\n  }).then((res) =\u003e res.text())\n  // {\"success\": false}\n  console.log(body_not_equal)\n  await serser.stop()\n}\n\nasync function callToServerPartialExpected() {\n  const model_obj = {\n    \"port\": \"8081\",\n    \"debug\": true, // if this prop exists log will show all results in console, defailt is false\n    \"api\": [{\n      \"method\": \"POST\",\n      \"path\": \"/user\",\n      \"request_body_equal\": {\n        \"status\": 404,\n        \"not_equal_response\": { // this field is optional, default is {\"data\": \"invalid request\"}\n          \"success\": false\n        },\n        \"allow_partial_expected_body\": true,\n        \"expected_body\": {\n          \"username\": \"test_\",\n          \"password\": \"test_pass\"\n        }\n      },\n      \"response\": {\n        \"success\": true\n      }\n    }]\n  }\n\n  const serser = await fakeServer(model_obj)\n\n  const body_equal_success = await fetch('http://localhost:8081/test', {\n    method: 'POST',\n    headers: {'Content-Type': 'application/json'},\n    body: JSON.stringify({\"username\": \"test_\", \"password\": \"test_pass\", \"x\": 2, \"Y\": 2}) // more that required keys are in request body\n  }).then((res) =\u003e res.text())\n  // {\"success\":true}\n  console.log(body_equal_success)\n\n  const body_not_equal = await fetch('http://localhost:8081/test', {\n    method: 'POST',\n    headers: {'Content-Type': 'application/json'},\n    body: JSON.stringify({\n      \"username\": \"test_1\",\n      \"password\": \"test_pass\"\n    })\n  }).then((res) =\u003e res.text())\n  // {\"success\": false}\n  console.log(body_not_equal)\n  await serser.stop()\n}\n```\n\n## Several server nodes in one environment\n```js\nconst fakeServer = require('test-fake-server')\n\n\nconst model_entry_point = {\n  \"port\": 8081,\n  \"api\": [\n    {\n      \"method\": \"GET\",\n      \"path\": \"/user\",\n\n      \"response_from_url\": { // if this property exists this endpoint will try to use it as main\n        \"status\": 201, // response status\n        \"method\": \"GET\", // method what will use for request for other HTTP service\n        \"url\": \"http://localhost:8888/userData\",  // URL to other service endpoint\n        \"merge_with\": { // if this property exists response from URL will merged with this property value\n                        // for example from http://localhost:8888/userData we will get {user: \"exists\"}\n                        // after merge with this property value {user: \"exists\", part_from_entrypoint: \"entry point\"}\n                        // so after request to http://localhost:8081/user\n                        // we will get {user: \"exists\", part_from_entrypoint: \"entry point\"}\n          \"part_from_entrypoint\": \"entry point\"\n        }\n      }\n    }\n  ]\n}\n\nconst model_user = {\n  \"port\": 8888,\n  \"api\": [\n    {\n      \"method\": \"GET\",\n      \"path\": \"/userData\",\n      \"response\": {\n        \"part_from_user_service\": {\n          \"user_profile\": {\n            \"username\": \"some username\",\n            \"postal_code\": 3212654\n          }\n        }\n      }\n    }\n  ]\n}\n\n\n\nasync function callToServer() {\n  const entry = await fakeServer(model_entry_point)\n  const userSerice = await fakeServer(model_user)\n  const getData = await fetch('http://localhost:8081/user',\n    {method: 'GET'}).then((res) =\u003e res.json())\n  // {\n  // part_from_user_service:\n  //   { user_profile: { username: 'some username', postal_code: 3212654 } },\n  //  part_from_entrypoint: 'entry point'\n  //  }\n  console.log(getData)\n await entry.stop()\n  await userSerice.stop()\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotapovdim%2Fjson-fake-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotapovdim%2Fjson-fake-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotapovdim%2Fjson-fake-server/lists"}