0.3.0 • Published 7 years ago
generator-amur v0.3.0
Generator Amur
Gimme a koa mongoose graphQL app
Setup an Amur Project
Assume that you have node.js and npm installed.
First, install Yeoman and Generator Amur.
npm install -g yo
npm install -g generator-amurThen generate your new project:
yo amur my-new-appIf you don't specify app name, the app will be installed to your current working directory.
Generate Resources
Amur resource generator follows this style
yo amur:resource YourModelName field1:Type1 field2:Type2 ref1:RefType1 ref2:RefType2:foreignKeyLet's say you have a model named user, and user has a name, age and also a list of posts. And you have a model named post, it has title, content and author. Just type like this:
yo amur:resource User name:String age:Int posts:[Post]:author
yo amur:resource Post title:String content:String author:UserAnd then open npm start to try out auto generated API suite.
Destroy Resources
If you mistakenly generated something or you spell something wrongly, you want to undo:
yo amur:resource ResourceToDelete --destroy --forceLicense
MIT © Zhang Kaiyu