Is there a way to auto generate a Rest service in node.js like in rails? I just want to expose my mongodb models as a Restfull service. I am now doing a lot of repetitive work with Mongoose and express-resource.
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Design RESTful service with multiple ids
- Axios OPTIONS instead of POST Request. Express Res
- Plain (non-HTML) error pages in REST api
- Laravel 5.1 MethodNotAllowedHttpException on store
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- MongoError: cannot infer query fields to set, path
- Got ActiveRecord::AssociationTypeMismatch on model
- Multiple parameters in AngularJS $resource GET
Yep, it's possible, follow this commands:
That's it! If you need to generate nested resource:
and modify config/routes.js:
Check this example app: https://github.com/anatoliychakkaev/railway-example-app
Welcome to railway: http://railwayjs.com
You can also use a library I developed if Railway is too bulky for your needs:
https://github.com/enyo/mongo-rest
It's a simple library, well tested, that just provides a REST interface for your mongoose models.