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.js 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.
If you want MVC framework in node js with generator functionalities then my prefer
also routes and syntax are more similar to ruby on rails
You can also do CRUD through it by compound generate crud post title content
for controller compound g controller controllername actionName anotherActionName
for Model compound g model user name password createdAt:date activated:boolean
For Scaffold compound g scaffold post title content createdAt:date
Thanks