Koa' application generator.
$ npm install -g koa2-generator
The quickest way to get started with koa2 is to utilize the executable koa2(1)
to generate an application as shown below:
Create the app:
if you use hogan template engine
$ koa2 --view hogan ./app && cd ./app
if you want use yarn manage your application modules
$ npm i -g yarn
Install dependencies:
$ npm install
or
$ yarn install
Start your Koa app at http://localhost:3000/
:
$ npm start
or
$ yarn start
This generator can also be further configured with the following command line flags.
Usage: koa2 [options] [dir]
options:
-h, --help output usage information
-v, --version output the version number
-e, --ejs add ejs engine support
--hbs add handlebars engine support
--pug add pug engine support
--hjs add hogan.js engine support
--njk add nunjucks engine support
--view <engine> add view <engine> support (ejs|hbs|hogan|jade|pug|twig|vash) (defaults to jade)
-c, --css <engine> add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)
--git add .gitignore
-f, --force force on non-empty directory