Model-driven REST API framework using decorators
Modern REST API framework. https://xurei.github.io/restgoose
Restgoose exposes your MongoDB database through a REST API with ease. It is driven by the model itself, which reduces the boilerplate code necessary to write simple endpoints. It is open for extension, so you can add complex logic easily too.
npm install @xureilab/restgoose
This creates the typical CRUD endpoints on a model :
import { Restgoose, RestgooseModel, all, create, one, prop, remove, rest, update } from '@xureilab/restgoose';
@rest({
route: '/todos',
methods: [
all(), // GET /todos
one(), // GET /todos/:id
create(), // POST /todos
update(), // PATCH /todos/:id
remove(), // DELETE /todos/:id
],
})
export class Todo extends RestgooseModel {
@prop({required: true})
name: string;
}
See the full example (with express/mongoose boilerplates) in the examples directory
Check out the docs for details.
Restgoose takes its inspiration from Typegoose and Loopback. We also had some objectives in mind while writing Restgoose :
We are looking for collaborators to test the framework in real-world situations, and also make the development faster. Check out the roadmap to see what's going on.
Reddit: https://www.reddit.com/r/restgoose/