{"id":15014248,"url":"https://github.com/pabloibanezcom/node-express-mongodb","last_synced_at":"2026-03-01T11:31:49.888Z","repository":{"id":57311332,"uuid":"108278774","full_name":"pabloibanezcom/node-express-mongodb","owner":"pabloibanezcom","description":"Skeleton api app with Node Express and MongoDB","archived":false,"fork":false,"pushed_at":"2019-09-12T09:03:42.000Z","size":136,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T18:42:11.167Z","etag":null,"topics":["api","express","mongodb","mongoose","nodejs","passport-facebook","passportjs","postman"],"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/pabloibanezcom.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":"2017-10-25T14:05:42.000Z","updated_at":"2023-07-27T07:03:02.000Z","dependencies_parsed_at":"2022-09-06T03:32:16.113Z","dependency_job_id":null,"html_url":"https://github.com/pabloibanezcom/node-express-mongodb","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pabloibanezcom/node-express-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloibanezcom%2Fnode-express-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloibanezcom%2Fnode-express-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloibanezcom%2Fnode-express-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloibanezcom%2Fnode-express-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pabloibanezcom","download_url":"https://codeload.github.com/pabloibanezcom/node-express-mongodb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloibanezcom%2Fnode-express-mongodb/sbom","scorecard":{"id":717184,"data":{"date":"2025-08-11","repo":{"name":"github.com/pabloibanezcom/node-express-mongodb","commit":"a939a170da74384b8c9d454dbcf31f76402d034f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":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"}}]},"last_synced_at":"2025-08-22T10:04:07.392Z","repository_id":57311332,"created_at":"2025-08-22T10:04:07.392Z","updated_at":"2025-08-22T10:04:07.392Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29968462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T10:55:55.490Z","status":"ssl_error","status_checked_at":"2026-03-01T10:55:55.175Z","response_time":124,"last_error":"SSL_read: 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":["api","express","mongodb","mongoose","nodejs","passport-facebook","passportjs","postman"],"created_at":"2024-09-24T19:45:22.293Z","updated_at":"2026-03-01T11:31:49.870Z","avatar_url":"https://github.com/pabloibanezcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NODE-EXPRESS-MONGODB.API\n\nThis project allows you to create a powerful REST API in a very short time. It relies on \n\n[NodeJS](https://nodejs.org/en/) | [Express](https://expressjs.com/)\n| [MongoDB](https://www.mongodb.com/) | [Mongoose](http://mongoosejs.com/) | [PassportJS](http://www.passportjs.org/)\n\n\u003c!-- Badges section here. --\u003e\n\n[![npm](https://img.shields.io/npm/v/node-express-mongodb.svg)][npm-badge-url]\n[![npm](https://img.shields.io/npm/l/node-express-mongodb.svg)][npm-badge-url]\n[![npm](https://david-dm.org/pabloibanezcom/node-express-mongodb/status.svg)][david-dependency-url]\n\n[![GitHub forks](https://img.shields.io/github/forks/pabloibanezcom/node-express-mongodb.svg?style=social\u0026label=Fork)](https://github.com/pabloibanezcom/node-express-mongodb/fork)\n[![GitHub stars](https://img.shields.io/github/stars/pabloibanezcom/node-express-mongodb.svg?style=social\u0026label=Star)](https://github.com/pabloibanezcom/node-express-mongodb)\n\n## Table of Contents\n\n* [Instalation](#instalation)\n* [Usage](#usage)\n* [Authentication](#authentication)\n* [Data generation](#data-generation)\n* [Postman project generation](#postman-project-generation)\n* [License](#license)\n\n## Instalation\n\n```bash\nnpm install node-express-mongodb --save\n```\n\n## Usage\n\nOnce express application is created we need to instantiate node-express-mongodb:\n\n```bash\nrequire('node-express-mongodb')(app, options, passport);\n```\n\n### Options\n\nKey  | Description \n---       | ---\nAPP_NAME | Name of the application\nMONGODB_URI | MongoDB database URI\nHOST | Host url. *Only for Postman purposes (optional)*\nPORT | Port number. *Only for Postman purposes (optional)*\nMODELS_PATH | Path where the models are located. *Default: `./app/models`* *(optional)*\nDATA_PATH | Path where data for generation is located. *Default: `./app/data`* *(optional)*\n\n### Models\n\nThe way it generates the API is by reading each of the model definitions at models path. We need to create one definition for each of the models in our app. This needs to be a json similar to the one below:\n\n```bash\n{\n    \"name\": \"BasicExample\",\n    \"route\": \"basicexample\",\n    \"properties\": {\n        \"property1\": {\n            \"type\": \"String\"\n        },\n        \"property2\": {\n            \"type\": \"String\",\n            \"methodsNotAllowed\": {\n                \"update\": true\n            }\n        },\n        \"property3\": {\n            \"type\": \"Number\",\n            \"methodsNotAllowed\": {\n                \"add\": true\n            }\n        }\n    },\n    \"methods\": {\n        \"getAll\": { \"enabled\": true },\n        \"get\": { \"enabled\": true, \"passportStrategy\": \"admin\" },\n        \"add\": { \"enabled\": true },\n        \"update\": { \"enabled\": true },\n        \"remove\": { \"enabled\": true }\n    }\n}\n```\n\nOnce the app is started it generates all the routes based on them.\n\n### Default routes\n\nThere are 5 default routes. These are created if they are activated in the model.\n\nRoute  | Description \n---       | ---\nGET api/[modelRoute] | Returns all the documents\nGET api/[modelRoute]/:id | Returns one document\nPOST api/[modelRoute] | Creates one document\nPUT api/[modelRoute]/:id | Updates one document\nDELETE api/[modelRoute]/:id | Remove one document \n\n### Custom routes\n\nIt is possible to create custom routes. For this you have to add a route file to `./app/routes` and the service to use to `./app/services`. Both files must be named as the route in  modeldefinition.\n\n## Authentication\n\nIt is possible to add authentication to the routes by PassportJS. The way to do this is by defining the `passportStrategy`in the method object:\n\n`\"methods\": {\"get\": { \"enabled\": true, \"passportStrategy\": \"admin\" }}`\n\n**[!]** Note that in this case admin strategy would need to be defined in passport.js\n\n## Data generation\n\nIt is possible to auto generate data in the DB for dev purposes by just adding a collection to a json file named as the model in `./generation/data`.\n\nIn order to run this task an extra endpoint is set up. ***/api/admin/generate***.\n\n## Postman project generation\n\nA Postman configuration object is generated by default so it can be easily imporated in Postman to get the collection of all endpoints in the app.\n\nAll you have to do in Postman is\n\n*Import \u003e Import From Link* and copying the follow app endpoint:\n\n***/api/postman***\n\n## License\n\nMIT\n\n\n[npm-badge-url]: https://www.npmjs.com/package/node-express-mongodb\n[david-dependency-url]: https://david-dm.org/pabloibanezcom/node-express-mongodb\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabloibanezcom%2Fnode-express-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpabloibanezcom%2Fnode-express-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabloibanezcom%2Fnode-express-mongodb/lists"}