generator-amur
v0.3.0
Published
Gimme a koa mongoose graphQL app
Downloads
2
Maintainers
Readme
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-amur
Then generate your new project:
yo amur my-new-app
If 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:foreignKey
Let'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:User
And 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 --force
License
MIT © Zhang Kaiyu