A high-performance, secure proxy for MongoDB built with Fastify and TypeScript. It features Role-Based Access Control (RBAC), dynamic query parsing, and interactive Swagger documentation.
docker pull jodurpar/dsmongodbapi:latest
By default, the API listens on port 15240 and connects to mongodb://localhost:27017.
docker run -d \
--name dsmongodb \
-p 15240:15240 \
-e MONGODB_URI="mongodb://your-mongo-host:27017" \
jodurpar/dsmongodbapi:latest
If your MongoDB instance is running on a non-standard port (e.g., 27018, 27019), you must specify it in the MONGODB_URI environment variable.
docker run -d \
--name dsmongodb \
-p 15240:15240 \
-e MONGODB_URI="mongodb://host.docker.internal:27018" \
jodurpar/dsmongodbapi:latest
| Variable | Description | Default |
|---|---|---|
PORT | API listening port | 15240 |
MONGODB_URI | MongoDB connection string | mongodb://localhost:27017 |
MONGODB_DATABASE | Default database name | test |
LOG_LEVEL | Logging level (trace, debug, info, etc.) | info |
Once running, access the interactive documentation at:
http://localhost:15240/docs
For detailed CRUD examples and coding integration, visit the GitHub Repository.
The project includes a suite of unit tests built with Jest to ensure query parsing and connection management accuracy. To run them locally:
npm test
Ensure you configure your RBAC settings if you intend to use this in production. The proxy requires client-authorization headers for mapped roles.
© 2026 José Durán Pareja. Released under the MIT License.
Content type
Image
Digest
sha256:fdc670b0a…
Size
66.7 MB
Last updated
7 months ago
docker pull jodurpar/dsmongodbapi