Hacker News new | ask | show | jobs
by aciswhat 2191 days ago
Hello Hacker News! This is something I quickly prototyped yesterday to automatically generate a REST API from existing Mongoose schemas. It's incredibly useful for mocking your exact backend, or just spinning up an MVP backend.

Authentication is also built in (currently only supports email/password, but more in the works). I implemented granular permissions for API routes that can be set via configuration really easily, which uses JWTs from the user login.

1 comments

>> Creates a hot-reloading server that auto-updates whenever models are updated or created.

This is neat.

Does this mean - if your generator finds a new model in mongodb, it autogenerates model file within the folder and vice-versa it creates APIs if there is a new model file within model folder ?

Yes, if it finds a new model in the `./models` folder, it'll automatically create those endpoints!