generator-amur

0.3.0 • Public • Published

Generator Amur

NPM version Build Status Dependency Status

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

Package Sidebar

Install

npm i generator-amur

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

32.6 kB

Total Files

35

Last publish

Collaborators

  • cheunghy