{"id":13447647,"url":"https://github.com/diegohaz/rest","last_synced_at":"2026-04-20T20:01:21.509Z","repository":{"id":38454664,"uuid":"67553298","full_name":"diegohaz/rest","owner":"diegohaz","description":"REST API generator with Node.js, Express and Mongoose","archived":false,"fork":false,"pushed_at":"2023-01-07T04:06:33.000Z","size":1611,"stargazers_count":1813,"open_issues_count":66,"forks_count":308,"subscribers_count":68,"default_branch":"master","last_synced_at":"2026-03-14T18:56:13.712Z","etag":null,"topics":["boilerplate","jest","mongodb","mongoose","rest","rest-api","yeoman-generator"],"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/diegohaz.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":"2016-09-06T23:05:11.000Z","updated_at":"2026-03-04T01:15:11.000Z","dependencies_parsed_at":"2023-02-06T11:16:22.272Z","dependency_job_id":null,"html_url":"https://github.com/diegohaz/rest","commit_stats":null,"previous_names":["diegohaz/generator-rest"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/diegohaz/rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Frest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Frest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Frest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Frest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diegohaz","download_url":"https://codeload.github.com/diegohaz/rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diegohaz%2Frest/sbom","scorecard":{"id":341389,"data":{"date":"2025-08-11","repo":{"name":"github.com/diegohaz/rest","commit":"a126563ed694eaf1df35c7c24bfad4df6f08aca9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":4,"reason":"Found 14/30 approved changesets -- score normalized to 4","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"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":"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 16 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":"119 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-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-5wg4-74h6-q47v","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-vhxc-fhm5-qcp9","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-832h-xg76-4gv6","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-4jwp-vfvf-657p","Warn: Project is vulnerable to: GHSA-v8w9-2789-6hhr","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-h452-7996-h45h","Warn: Project is vulnerable to: GHSA-897m-rjf5-jp39","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-qgfr-5hqp-vrw9","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","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-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-4hpf-3wq7-5rpr","Warn: Project is vulnerable to: GHSA-f522-ffg8-j8r6","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","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-675m-85rw-j3w4","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","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-hxm2-r34f-qmc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-f825-f98c-gj3g","Warn: Project is vulnerable to: GHSA-h8hf-x3f4-xwgp","Warn: Project is vulnerable to: GHSA-9m93-w8w6-76hh","Warn: Project is vulnerable to: GHSA-m7xq-9374-9rvx","Warn: Project is vulnerable to: GHSA-vg7j-7cwx-8wgw","Warn: Project is vulnerable to: GHSA-p92x-r36w-9395","Warn: Project is vulnerable to: GHSA-45q2-34rf-mr94","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-v923-w3x8-wh69","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-gqgv-6jq5-jjj9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p23c-p8w2-ww5v","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-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","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-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472","Warn: Project is vulnerable to: GHSA-v2p6-4mp7-3r9v","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","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-18T05:58:47.490Z","repository_id":38454664,"created_at":"2025-08-18T05:58:47.490Z","updated_at":"2025-08-18T05:58:47.490Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32063458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["boilerplate","jest","mongodb","mongoose","rest","rest-api","yeoman-generator"],"created_at":"2024-07-31T05:01:23.356Z","updated_at":"2026-04-20T20:01:21.489Z","avatar_url":"https://github.com/diegohaz.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Tecnology"],"sub_categories":["Node.js"],"readme":"# rest [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage percentage][coveralls-image]][coveralls-url]\n\u003e RESTful API generator using NodeJS, Express and Mongoose\n\n📹 [Watch this video](https://www.youtube.com/watch?v=6x-ijyG-ack) for an overview on how to use **generator-rest** and deploy your project to [Heroku](https://heroku.com).\n\n\u003cbr\u003e\n\u003chr\u003e\n\u003cp align=\"center\"\u003e\nIf you find this useful, please don't forget to star ⭐️ the repo, as this will help to promote the project.\u003cbr\u003e\nFollow me on \u003ca href=\"https://twitter.com/diegohaz\"\u003eTwitter\u003c/a\u003e and \u003ca href=\"https://github.com/diegohaz\"\u003eGitHub\u003c/a\u003e to keep updated about this project and \u003ca href=\"https://github.com/diegohaz?tab=repositories\"\u003eothers\u003c/a\u003e.\n\u003c/p\u003e\n\u003chr\u003e\n\u003cbr\u003e\n\n## Features\n\n - **Highly customizable** - You can choose what to install\n - **Really RESTful** - It follows the best practices\n - **ES6!** - Using [babel](https://babeljs.io/)\n - **User registration API** - Using [passport](http://passportjs.org/) (optional)\n - **Social login API** - Facebook, Google and GitHub (optional)\n - **Password reset API** - Sending emails with [SendGrid API](https://sendgrid.com/docs/API_Reference/index.html) (optional)\n - **Listing query strings** - `q`, `page`, `limit`, `fields` etc. already provided by [querymen](https://github.com/diegohaz/querymen)\n - **Query string validator** - Using [querymen](https://github.com/diegohaz/querymen)\n - **Request body validator** - Using [bodymen](https://github.com/diegohaz/bodymen)\n - **Standard error responses** - Using [querymen](https://github.com/diegohaz/querymen) and [bodymen](https://github.com/diegohaz/bodymen) error handlers\n - **Unit and integration tests** - Using [Jest](https://github.com/facebook/jest)\n - **Continuous integration support** - Using [Travis CI](https://travis-ci.org/)\n - **API docs generator** - Using [apidoc](http://apidocjs.com/)\n - **Love ♥** - Using [me](https://github.com/diegohaz)\n\n## Installation\n\nFirst, install [Yeoman](http://yeoman.io) and generator-rest using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).\n\n```bash\nnpm install -g yo\nnpm install -g generator-rest\n```\n\n## Generators\n\nThen, you can use `yo` to generate your project.\n\n```bash\nyo rest # generate a new project\nyo rest:api # generate a new api endpoint inside your project\n```\n\n## Commands\n\nAfter you generate your project, these commands are available in `package.json`.\n\n```bash\nnpm test # test using Jest\nnpm run coverage # test and open the coverage report in the browser\nnpm run lint # lint using ESLint\nnpm run dev # run the API in development mode\nnpm run prod # run the API in production mode\nnpm run docs # generate API docs\n```\n\n## Playing locally\n\nFirst, you will need to install and run [MongoDB](https://www.mongodb.com/) in another terminal instance.\n\n```bash\n$ mongod\n```\n\nThen, run the server in development mode.\n\n```bash\n$ npm run dev\nExpress server listening on http://0.0.0.0:9000, in development mode\n```\n\nIf you choose to generate the authentication API, you can start to play with it.\n\u003e Note that creating and authenticating users needs a master key (which is defined in the `.env` file)\n\nCreate a user (sign up):\n```bash\ncurl -X POST http://0.0.0.0:9000/users -i -d \"email=test@example.com\u0026password=123456\u0026access_token=MASTER_KEY_HERE\"\n```\n\nIt will return something like:\n```bash\nHTTP/1.1 201 Created\n...\n{\n  \"id\": \"57d8160eabfa186c7887a8d3\",\n  \"name\": \"test\",\n  \"picture\":\"https://gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?d=identicon\",\n  \"email\": \"test@example.com\",\n  \"createdAt\": \"2016-09-13T15:06:54.633Z\"\n}\n```\n\nAuthenticate the user (sign in):\n```bash\ncurl -X POST http://0.0.0.0:9000/auth -i -u test@example.com:123456 -d \"access_token=MASTER_KEY_HERE\"\n```\n\nIt will return something like:\n```bash\nHTTP/1.1 201 Created\n...\n{\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\",\n  \"user\": {\n    \"id\": \"57d8160eabfa186c7887a8d3\",\n    \"name\": \"test\",\n    \"picture\": \"https://gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?d=identicon\",\n    \"email\": \"test@example.com\",\n    \"createdAt\":\"2016-09-13T15:06:54.633Z\"\n  }\n}\n```\n\nNow you can use the `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9` token (it's usually greater than this) to call user protected APIs. For example, you can create a new `article` API using `yo rest:api` and make the `POST /articles` endpoint only accessible to authenticated users. Then, to create a new article you must pass the `access_token` parameter.\n```bash\ncurl -X POST http://0.0.0.0:9000/articles -i -d \"title=Awesome Article\u0026content=Yeah Baby\u0026access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\"\n```\n\nIt will return something like:\n```bash\nHTTP/1.1 201 Created\n...\n{\n  \"id\": \"57d819bfabfa186c7887a8d6\",\n  \"title\": \"Awesome Article\",\n  \"content\": \"Yeah Baby\",\n  \"createdAt\": \"2016-09-13T15:22:39.846Z\",\n  \"updatedAt\":\"2016-09-13T15:22:39.846Z\"\n}\n```\n\n\u003e Some endpoints are only accessible by admin users. To create an admin user, just pass the `role=admin` along to other data when calling `POST /users`.\n\n## Deploy\n\nHere is an example on how to deploy to [Heroku](https://heroku.com) using [Heroku CLI](https://devcenter.heroku.com/articles/heroku-command-line):\n```bash\n# start a new local git repository\ngit init\n\n# create a new heroku app\nheroku apps:create my-new-app\n\n# add heroku remote reference to the local repository\nheroku git:remote --app my-new-app\n\n# add the MongoLab addon to the heroku app\nheroku addons:create mongolab\n\n# set the environment variables to the heroku app (see the .env file in root directory)\nheroku config:set MASTER_KEY=masterKey JWT_SECRET=jwtSecret\n\n# commit and push the files\ngit add -A\ngit commit -m \"Initial commit\"\ngit push heroku master\n\n# open the deployed app in the browser\nheroku open\n```\n\nThe second time you deploy, you just need to:\n\n```bash\ngit add -A\ngit commit -m \"Update code\"\ngit push heroku master\n```\n\n## Directory structure\n\n### Overview\n\nYou can customize the `src` and `api` directories.\n\n```\nsrc/\n├─ api/\n│  ├─ user/\n│  │  ├─ controller.js\n│  │  ├─ index.js\n│  │  ├─ index.test.js\n│  │  ├─ model.js\n│  │  └─ model.test.js\n│  └─ index.js\n├─ services/\n│  ├─ express/\n│  ├─ facebook/\n│  ├─ mongoose/\n│  ├─ passport/\n│  ├─ sendgrid/\n│  └─ your-service/\n├─ app.js\n├─ config.js\n└─ index.js\n```\n\n### src/api/\n\nHere is where the API endpoints are defined. Each API has its own folder.\n\n#### src/api/some-endpoint/model.js\n\nIt defines the Mongoose schema and model for the API endpoint. Any changes to the data model should be done here.\n\n#### src/api/some-endpoint/controller.js\n\nThis is the API controller file. It defines the main router middlewares which use the API model.\n\n#### src/api/some-endpoint/index.js\n\nThis is the entry file of the API. It defines the routes using, along other middlewares (like session, validation etc.), the middlewares defined in the `some-endpoint.controller.js` file.\n\n### services/\n\nHere you can put `helpers`, `libraries` and other types of modules which you want to use in your APIs.\n\n## TODO\n\n- Support optional phone authentication\n- Support optional email confirmation process\n- Support Twitter and other social login methods\n- Socket.io support\n\nPRs are welcome.\n\n## Credits\n\n[@QzSG](https://github.com/QzSG) and all [contributors](https://github.com/diegohaz/generator-rest/graphs/contributors)\n\n## License\n\nMIT © [Diego Haz](https://github.com/diegohaz)\n\n\n[npm-image]: https://badge.fury.io/js/generator-rest.svg\n[npm-url]: https://npmjs.org/package/generator-rest\n[travis-image]: https://travis-ci.org/diegohaz/rest.svg?branch=master\n[travis-url]: https://travis-ci.org/diegohaz/rest\n[coveralls-image]: https://coveralls.io/repos/diegohaz/rest/badge.svg\n[coveralls-url]: https://coveralls.io/r/diegohaz/rest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegohaz%2Frest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegohaz%2Frest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegohaz%2Frest/lists"}