Skip to content
Model-driven REST API framework using decorators
TypeScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
examples Fixed small issues Jan 15, 2019
scripts Doc : new layout Jan 14, 2019
src Allow one() to use a filter (`GET ?q=...`), the same way all() does. Aug 23, 2019
test
.editorconfig
.gitignore gitignore Aug 14, 2019
.npmignore
CHANGELOG.md
CODE_OF_CONDUCT.md Docs change Feb 19, 2019
CONTRIBUTING.md Docs change Feb 19, 2019
LICENSE
README.md Update README May 14, 2019
codecov.yml
mocha.opts
package-lock.json
package.json
renovate.json
tsconfig.json
tslint.json
wercker.yml Add codacy coverage reporter - final Jan 18, 2019

README.md

Restgoose

Modern REST API framework. https://xurei.github.io/restgoose

npm version wercker status codecov Codacy Badge

CII Best Practices npms score reddit

wercker status

MongoDB + Typescript + 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

npm install @xureilab/restgoose

Minimal usage

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.

The Philosophy behind Restgoose

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

  • Simple, common behaviors should be really easy to write,
  • The framework should follow a RESTful design,
  • The framework should be simple to add in an existing project,
  • While promoting some best practices, the framework should let the user add complex endpoints without Restgoose if necessary
  • The framework should be small and provide as little middlewares as necessary. Plugins will be created for better cherry-picking.

Contribute

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.

Community

Reddit: https://www.reddit.com/r/restgoose/

Support on Beerpay

Beerpay Beerpay

You can’t perform that action at this time.