I want to write my own scaffold generator for Express Framework. I do realize that there are frameworks that do that, but I want to write my own. I'd like the functionality to be similar to Rails.
For example:
generate model user name:String email:String
should create user.js
in the models directory, with the two specified fields in the schema.
I also want to generate the controller for the model, with the crud operations using the db connector:
generate controller users mongoose
should create users.j
s in the controllers directory and should contain the crud operations based on mongoose api.
How do I go about doing the same?
PS: The back end is a REST API for an IOS app, so I'm not interested in generating views.