{"id":23843678,"url":"https://github.com/ngduc/api-now","last_synced_at":"2025-11-05T14:02:29.324Z","repository":{"id":37733274,"uuid":"209855034","full_name":"ngduc/api-now","owner":"ngduc","description":"$ api-now - Launch an API Server to serve a JSON, JS file, GraphQL or faker data with HTTPS support.","archived":false,"fork":false,"pushed_at":"2020-04-18T21:05:42.000Z","size":4100,"stargazers_count":110,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-10T04:14:00.579Z","etag":null,"topics":["api","https","https-server","json","json-server","mock","mock-server","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/ngduc.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}},"created_at":"2019-09-20T18:20:59.000Z","updated_at":"2025-08-14T09:45:49.000Z","dependencies_parsed_at":"2022-09-16T06:12:28.528Z","dependency_job_id":null,"html_url":"https://github.com/ngduc/api-now","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ngduc/api-now","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fapi-now","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fapi-now/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fapi-now/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fapi-now/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngduc","download_url":"https://codeload.github.com/ngduc/api-now/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngduc%2Fapi-now/sbom","scorecard":{"id":683045,"data":{"date":"2025-08-11","repo":{"name":"github.com/ngduc/api-now","commit":"2a66357896587e52d5b627ba390efdb1cabc1cd3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/ngduc/api-now/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/ngduc/api-now/nodejs.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:22","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"73 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-w42g-7vfc-xf37","Warn: Project is vulnerable to: GHSA-j5g3-5c8r-7qfx","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-h452-7996-h45h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-cwx2-736x-mf6w","Warn: Project is vulnerable to: GHSA-v39p-96qg-c8rf","Warn: Project is vulnerable to: GHSA-8v63-cqqc-6r2c","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T23:48:56.637Z","repository_id":37733274,"created_at":"2025-08-21T23:48:56.637Z","updated_at":"2025-08-21T23:48:56.637Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282831702,"owners_count":26734536,"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-11-05T02:00:05.946Z","response_time":58,"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":["api","https","https-server","json","json-server","mock","mock-server","server"],"created_at":"2025-01-02T19:50:42.377Z","updated_at":"2025-11-05T14:02:29.289Z","avatar_url":"https://github.com/ngduc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐕 api-now\n\n\u003cimg src=\"docs/logo.png\" height=\"100\" /\u003e\n\u003cimg src=\"https://github.com/ngduc/api-now/workflows/Node%20CI/badge.svg\" /\u003e\n\nLaunch an API Server to serve a JSON, JS file, GraphQL or faker data with HTTPS support.\n\nBased on **json-server** with more features:\n- Default datasets out-of-the-box: todos, users, posts, comments (using faker). Just run `$ api-now`\n- HTTPS support (with key, cert files).\n- Can take a .json or .js file.\n- GraphQL endpoint to serve faker data: /graphql\n- Can serve a static directory (e.g. /dist, /public etc.)\n- APIs support pagination (_page, _limit).\n- /echo route to respond parameters back as json.\n- /file route to serve any file type (including images).\n- /login route (POST) to respond with a dummy JWT token (using jsonwebtoken).\n- /todos route to return a list of todo items (follow TodoMVC specs).\n- /image/random to serve a random image file from a directory.\n- /avatar/random to serve a random avatar image.\n- /nature/random to serve a random nature image.\n\n\u003cimg src=\"https://i.ibb.co/V2ZGrPh/api-now-demo.gif\" /\u003e\n\n## 🔧 Install\n\n- As a dependency: `$ npm install api-now`\n- As a global command: `$ npm install api-now -g`\n- Or run it without installing: `$ npx api-now`\n\n## 📖 Usage\n\n`$ api-now`\n\nThat's it! You can try it now:\n\n```\n$ curl http://localhost:3003/todos\n$ curl http://localhost:3003/users?_page=1\u0026_limit=5    (others: /posts /comments)\n\nOther Useful Routes:\n$ curl http://localhost:3003/echo?any=value\n$ curl http://localhost:3003/file?path=YourFilePath\n$ curl http://localhost:3003/image/random?path=YourDirPath\n$ curl http://localhost:3003/avatar/random\n$ curl http://localhost:3003/nature/random\n$ curl -X POST http://localhost:3003/login -H 'Content-Type: application/json' -d '{\"username\": \"test\"}'\n\nOpen GraphQL Query Page:\nopen http://localhost:3003/graphql\n\n$ curl 'http://localhost:3003/graphql' -H 'Content-Type: application/json' --data-binary '{\"query\":\"{ todos { title } }\"}'\n```\n\n## 📖 Serve data from a file\n\nCreate [db.json](tests/sample.json) file, then run api-now to start a HTTPS server at port 3003:\n```\n{\n  \"posts\": [\n    { \"id\": 1, \"title\": \"Post title 1\" },\n    { \"id\": 2, \"title\": \"Post title 2\" }\n  ]\n}\n```\n\n```\n$ api-now db.json\n$ api-now -k keyFile -c certFile -p 3003 -w db.json\n```\n\nOr create a .js file and use \"faker\" data like [generateData.js](tests/generateData.js)\n\n## 📖 Command line options:\n\n```\nUsage: api-now [options] [json or js file]\nOptions:\n  -c, --cert \u003ccertFile\u003e  HTTPS cert file\n  -k, --key \u003ckeyFile\u003e    HTTPS key file\n  -p, --port \u003cport\u003e      Use custom port\n  -s, --static \u003cdir\u003e     Serve static directory (examples: ./dist, ./public)\n  -v, --version          Show version\n  -w, --watch            Watch for changes and reload (default: false)\n  -h, --help             Output usage information\n```\n\n## 📖 Tips\n\n- json-server - [Repo \u0026 Documents](https://github.com/typicode/json-server)\n\n- Command line to generate self-signed Key \u0026 Cert files:\n\n`openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj \"/C=US/ST=California/L=San Francisco/O=Organization/CN=CommonName\" -keyout key.pem -out cert.pem`\n\n- Article: [Fake APIs for your UI ('til you make it!)](https://medium.com/javascript-in-plain-english/fake-apis-for-your-ui-til-you-make-it-b6a2da89fdaa)\n\n- Article: [How to create your command-line program (CLI) with NodeJS and Commander.js](https://medium.com/@ngduc/how-to-create-a-command-line-npm-module-cli-using-commander-js-1073e616aee7)\n\n- One more thing:\n  - ★ this repo, open PRs and dance :)\n\n## Development\n\nAll contributions are welcome!\n- [Development](docs/development.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngduc%2Fapi-now","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngduc%2Fapi-now","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngduc%2Fapi-now/lists"}