{"id":18554422,"url":"https://github.com/abhisek753/json_server","last_synced_at":"2026-05-01T03:38:36.045Z","repository":{"id":152063260,"uuid":"581260978","full_name":"Abhisek753/json_server","owner":"Abhisek753","description":"Json server deployment for an Fronted Application","archived":false,"fork":false,"pushed_at":"2023-02-28T07:53:40.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T15:27:30.972Z","etag":null,"topics":["db","json-api","json-api-response"],"latest_commit_sha":null,"homepage":"https://effulgent-salamander-1adc45.netlify.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Abhisek753.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-22T17:42:46.000Z","updated_at":"2023-02-28T07:48:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"526d944f-0794-4ad1-b5b7-08cf19d23232","html_url":"https://github.com/Abhisek753/json_server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abhisek753/json_server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhisek753%2Fjson_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhisek753%2Fjson_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhisek753%2Fjson_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhisek753%2Fjson_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abhisek753","download_url":"https://codeload.github.com/Abhisek753/json_server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhisek753%2Fjson_server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32484352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["db","json-api","json-api-response"],"created_at":"2024-11-06T21:21:53.398Z","updated_at":"2026-05-01T03:38:36.011Z","avatar_url":"https://github.com/Abhisek753.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e bankapp-mock-api\u003c/h1\u003e\n\u003cbr/\u003e\n\u003ch3\u003eCreated db.json data for fronted\u003c/h3\u003e\n\n#### Prerequisite\n* Create a folder\n```\nmkdir bankapp-mock-api\ncd bankapp-mock-api\n```\n\n#### Step 1: Create a node js project\n```\nnpm init -y\n```\n\n#### Step 2: Install json server dependency\n```\nnpm i json-server\n```\n\n#### Step 3: Create server.js\n```js\nconst jsonServer = require('json-server')\n\nconst server = jsonServer.create()\n\nconst router = jsonServer.router('db.json')\nconst middlewares = jsonServer.defaults()\n \nserver.use(middlewares)\nserver.use('/api', router)\nserver.listen(process.env.PORT || 5000, () =\u003e {\n  console.log('JSON Server is running')\n})\n\n\n```\n\n\n#### Step 4: Create db.json\n```js\n{\n    \"users\": [\n        { \"id\": 1, \"name\":\"Naresh Kumar H\", \"email\":\"nareshkumarh@live.com\", \n        \"password\":\"pass123\", \"role\": \"USER\"\n        },\n        { \"id\": 2, \"name\":\"Tushant\", \"email\":\"tushant@gmail.com\", \n            \"password\":\"pass123\", \"role\": \"ADMIN\"\n        }\n    ],\n    \"accounts\":[\n\n    ],\n    \"transactions\":[\n\n    ]\n}\n```\n\n#### Step 5: Run the Node JS Project\n```\nnode server.js\n```\n\n#### Step 6: Test - List Users API \n```\nhttp://localhost:5000/api/users\n```\n\nOutput:\n```js\n[\n {\n id: 1,\n name: \"Naresh Kumar H\",\n email: \"nareshkumarh@live.com\",\n password: \"pass123\",\n role: \"USER\"\n },\n{\n id: 2,\n name: \"Tushant\",\n email: \"tushant@gmail.com\",\n password: \"pass123\",\n role: \"ADMIN\"\n}\n]\n```\n\n#### Step 7: Test - View User Details API \n```\nhttp://localhost:5000/api/users/1\n```\n\nOutput:\n```js\n {\n id: 1,\n name: \"Naresh Kumar H\",\n email: \"nareshkumarh@live.com\",\n password: \"pass123\",\n role: \"USER\"\n }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhisek753%2Fjson_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhisek753%2Fjson_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhisek753%2Fjson_server/lists"}