{"id":27643545,"url":"https://github.com/devendra0192/sugarcosmetics_backend","last_synced_at":"2025-07-22T08:06:05.947Z","repository":{"id":88120571,"uuid":"579574108","full_name":"Devendra0192/sugarcosmetics_backend","owner":"Devendra0192","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-18T06:24:13.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T00:15:35.050Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Devendra0192.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,"zenodo":null}},"created_at":"2022-12-18T06:14:29.000Z","updated_at":"2022-12-20T06:03:35.000Z","dependencies_parsed_at":"2023-05-18T09:15:40.228Z","dependency_job_id":null,"html_url":"https://github.com/Devendra0192/sugarcosmetics_backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Devendra0192/sugarcosmetics_backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devendra0192%2Fsugarcosmetics_backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devendra0192%2Fsugarcosmetics_backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devendra0192%2Fsugarcosmetics_backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devendra0192%2Fsugarcosmetics_backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Devendra0192","download_url":"https://codeload.github.com/Devendra0192/sugarcosmetics_backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devendra0192%2Fsugarcosmetics_backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266455207,"owners_count":23931357,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2025-04-24T00:15:34.080Z","updated_at":"2025-07-22T08:06:05.938Z","avatar_url":"https://github.com/Devendra0192.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bankapp-mock-api\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%2Fdevendra0192%2Fsugarcosmetics_backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevendra0192%2Fsugarcosmetics_backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevendra0192%2Fsugarcosmetics_backend/lists"}