GitHub - codeaholicguy/koajs-starter-kit: Simple starter kit for using KoaJS to build a web application written in ES7.

1 min read Original article ↗

KoaJS Starter Kit —

Simple starter kit for using KoaJS to build a web application written in ES7.

Getting Started

Just clone and explore it!

Sample

@controller('/sample')
export default class SampleController extends BaseController {
  @get('/hello/:name')
  async sayHello(ctx, next) {
    ctx.body = `Hello ${ctx.params.name}`
  }

  @get('/goodbye')
  async goodbye(ctx, next) {
    ctx.status = HttpStatusCodes.OK
  }
}

Commands

Start your web application at localhost:3000. You can also specify the port by PORT=8080 yarn start.

If you want to run the test suite. I use Jest for testing.

License

MIT