{"id":15138379,"url":"https://github.com/louis030195/rustlang-rocket-mongodb","last_synced_at":"2026-02-27T20:13:40.624Z","repository":{"id":105957371,"uuid":"217293665","full_name":"louis030195/rustlang-rocket-mongodb","owner":"louis030195","description":"Simple REST API with Rust, Rocket and Mongodb","archived":false,"fork":false,"pushed_at":"2019-10-24T12:37:15.000Z","size":7,"stargazers_count":29,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-24T17:55:10.674Z","etag":null,"topics":["api","mongodb","rocket","rust","rust-lang","web","web-dev","web-development"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/louis030195.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-24T12:27:58.000Z","updated_at":"2024-07-29T11:00:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc8901a8-fc55-4346-81a8-9158e1d94f0c","html_url":"https://github.com/louis030195/rustlang-rocket-mongodb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/louis030195/rustlang-rocket-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis030195%2Frustlang-rocket-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis030195%2Frustlang-rocket-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis030195%2Frustlang-rocket-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis030195%2Frustlang-rocket-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louis030195","download_url":"https://codeload.github.com/louis030195/rustlang-rocket-mongodb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis030195%2Frustlang-rocket-mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29911551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"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","mongodb","rocket","rust","rust-lang","web","web-dev","web-development"],"created_at":"2024-09-26T07:22:53.730Z","updated_at":"2026-02-27T20:13:40.576Z","avatar_url":"https://github.com/louis030195.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rustlang-rocket-mongodb\n[![Try it on gitpod](https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg)](https://gitpod.io/#https://github.com/louis030195/rustlang-rocket-mongodb)\n\nCode for the [tutorial](https://medium.com/@louis.beaumont/rest-api-with-rust-mongodb-10eeb6bd51d7)\n\n## Installation\n\n```bash\nsudo apt update\nsudo apt install mongodb-org\n```\n\nCheck if mongodb is healthy\n\n```bash\nservice mongodb status\n```\n\n## Usage\n\n```bash\necho -e \"MONGO_ADDR=localhost\nDB_NAME=rustlang-rocket-mongodb\nMONGO_PORT=27017\" \u003e .env\n```\n\n\n```bash\nrustup default nightly # Pear requires a nightly or dev version of Rust\n```\n\n```bash\ncargo run \u0026\n\n# POST\ncurl -d '{\"name\": \"chichi\"}' -H \"Content-Type: application/json\" -X POST http://localhost:8001/cats\n# Or\ncurl -d '{\"name\": \"chacha\", \"age\": 12, \"color\": \"grey\"}' \\\n-H \"Content-Type: application/json\" -X POST http://localhost:8001/cats\n# Or empty\ncurl -d '{}' -H \"Content-Type: application/json\" -X POST http://localhost:8001/cats\n\n# PUT\ncurl -d '{\"$oid\": \"5db15a686539303d5708901f\", \"name\": \"chichi\"}' -H \"Content-Type: application/json\" \\\n-X PUT http://localhost:8001/cats/5db15a686539303d5708901f\n\n# GET\ncurl http://localhost:8001/cats\n# Find by id\ncurl http://localhost:8001/cats/5db15a1f6539303d5708901e\n\n# DELETE\ncurl -H \"Content-Type: application/json\" -X DELETE http://localhost:8001/cats/5db15a1f6539303d5708901e\n\n# DELETE all\ncurl -H \"Content-Type: application/json\" -X DELETE http://localhost:8001/cats\n```\n\n## Tests\n\nTo avoid running parallel tests we use --test-threads=1 because we modify database, otherwise tests would fail.\n\n```rust\ncargo test -- --test-threads=1\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis030195%2Frustlang-rocket-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouis030195%2Frustlang-rocket-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis030195%2Frustlang-rocket-mongodb/lists"}