___ ___
/\ | |__| |__ |\ | /\
/~~\ | | | |___ | \| /~~\
A Slush generator for APIs
To use this generator you must have gulp
and slush
installed:
$ npm install -g gulp slush
Then install the generator:
$ npm install -g slush-athena
With the generator installed make a new project directory:
$ mdkir new_project
$ cd new_project
Scaffold your API:
$ slush athena
This will generate the following files:
.
├── server
│ └── api
│ └── index.js
│ └── config
│ └── environment # Environment configuration
│ ├── development.js
│ ├── index.js
│ ├── production.js
│ ├── staging.js
│ └── test.js
│ └── seed # Seed data
│ └── .gitkeep
│ └── express.js # Express configuration
│ └── lib
│ └── enums # Static objects
│ ├── errors.js
│ ├── index.js
│ └── errorHandler # Basic error handling
│ ├── errorHandler.spec.js
│ ├── index.js
│ ├── invalidPayload.js
│ ├── notFound.js
│ └── serverError.js
│ ├── app.js # Server bootstrap, config, and startup
│ └── routes.js # Routing
├── tasks # Modularized gulp tasks
│ ├── apidoc.js
│ ├── clean.js
│ ├── lint.js
│ ├── move.js
│ └── test.js
├── .athenarc # Athena generator configuration
├── .gitignore
├── .jshintrc
├── README.md
├── build-config.js # Build configuration for gulp
├── gulpfile.js
├── package.json
└── server.js # For simple app execution
$ slush athena:controller
Follow the prompts, and be sure to use a capitalcase name.
This will generate the following files:
.
├── server
│ ├── api
│ ├── <controller-name>
│ ├── index.js
│ ├── <controller-name>.controller.js
│ └── <controller-name>.controller.spec.js
$ slush athena:model
Follow the prompts, and be sure to use a capitalcase name.
This will generate the following files:
.
├── server
│ ├── api
│ ├── <model-name>
│ ├── <model-name>.model.js
│ └── <model-name>.model.spec.js