{"id":14975595,"url":"https://github.com/davidbuck/mongodb-express-node-rest-example","last_synced_at":"2026-02-12T23:03:56.933Z","repository":{"id":42848228,"uuid":"261954086","full_name":"DavidBuck/mongodb-express-node-rest-example","owner":"DavidBuck","description":" Simple REST API using Express, Mongoose and MongoDB","archived":false,"fork":false,"pushed_at":"2023-01-06T05:16:48.000Z","size":997,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T04:54:46.977Z","etag":null,"topics":["express-js","mongodb","mongoose-js"],"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/DavidBuck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-07T05:02:52.000Z","updated_at":"2020-10-24T00:13:45.000Z","dependencies_parsed_at":"2023-02-05T10:02:22.600Z","dependency_job_id":null,"html_url":"https://github.com/DavidBuck/mongodb-express-node-rest-example","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DavidBuck/mongodb-express-node-rest-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuck%2Fmongodb-express-node-rest-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuck%2Fmongodb-express-node-rest-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuck%2Fmongodb-express-node-rest-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuck%2Fmongodb-express-node-rest-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidBuck","download_url":"https://codeload.github.com/DavidBuck/mongodb-express-node-rest-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuck%2Fmongodb-express-node-rest-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274113528,"owners_count":25224425,"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-09-07T02:00:09.463Z","response_time":67,"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":["express-js","mongodb","mongoose-js"],"created_at":"2024-09-24T13:52:15.566Z","updated_at":"2026-02-12T23:03:56.874Z","avatar_url":"https://github.com/DavidBuck.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongoDB Express Node example Rest API\n\nThis is a simple REST API using Express, Mongoose and MongoDB.\n\nTo start the server:\n\n- start MongoDB on your local machine\n- `npm run start`\n\n## Routes\n\n**GET**\n\nGet all sensors - [http://localhost:3000/sensors](http://localhost:3000/sensors)\n\nGet a sensor - `http://localhost:3000/sensors/{id}`\n\nGet all sensorValues - [http://localhost:3000/sensorvalues](http://localhost:3000/sensorvalues)\n\nGet a sensor value - `http://localhost:3000/sensorvalues/{id}`\n\n**Post**\n\nCreate a sensor - `curl -X POST -H \"Content-Type:application/json\" http://localhost:3000/sensors -d '{\"sensorname\":\"Freezer Sensor 1\", \"type\": \"Arduino Uno\", \"location\":\"Main freezer\"}'`\n\nCreate a sensorValue - `curl -X POST -H \"Content-Type:application/json\" http://localhost:3000/sensorvalues -d '{\"temp\":\"25.4\", \"humidity\": \"82.2\", \"time\":\"1588833969189\", \"sensor\":\"{id}\"}'`\n\n**PUT**\n\nUpdate a sensor - `curl -X PUT -H \"Content-Type:application/json\" http://localhost:3000/sensors/{id} -d '{\"sensorname\":\"New Freezer Sensor\" , \"type\": \"Raspberry Pi\", \"location\":\"Main freezer\"}'`\n\nUpdate a sensorValue - `curl -X PUT -H \"Content-Type:application/json\" http://localhost:3000/sensorvalues/{id} -d '{\"temp\":\"2.4\", \"humidity\": \"82.2\", \"time\":\"1588832514\", \"sensor\":\"{id}\"}'`\n\n**Delete**\n\nDelete a sensor - `curl -X DELETE -H \"Content-Type:application/json\" http://localhost:3000/sensors/{id}`\n\nDelete a sensorValue - `curl -X DELETE -H \"Content-Type:application/json\" http://localhost:3000/sensorvalues/{id}`\n\n## Tools\n\n- [Express](https://www.npmjs.com/package/express)\n- [Mongoose](https://www.npmjs.com/package/mongoose)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbuck%2Fmongodb-express-node-rest-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidbuck%2Fmongodb-express-node-rest-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbuck%2Fmongodb-express-node-rest-example/lists"}