restgoose

Model-driven REST API framework using decorators


Project maintained by xurei Hosted on GitHub Pages — Theme by mattgraham

MongoDB + Typegoose + 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.

Installation & basic usage

npm install @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 Typegoose {
    /* ... */
}

Documentation

The Philosophy behind Restgoose

Restgoose takes its inspiration from Typegoose and Loopback. We also had some objectives in mind while writing Restgoose :