koa-babel-webpack-boilerplate

A simple boilerplate to create REST apps with koa2, babel and webpack

koa-babel-webpack-boilerplate

A simple boilerplate to create REST apps with * [email protected] (currently 2.0.0-alpha.3) * babel (for async, await and stage-2 support) * webpack


How to use

Boilerplate is packed with [email protected] in order to have a routing system.

Create a route

router.get('/:id', async (ctx) => {
  ctx.body = await database.get(ctx.params.id);
  // Feel the awesomeness
});

### Exceptions

This boilerplate contains a simple HTTP exception system in order to demonstrate how to deal with exceptions in koa. See exceptions.js.


Why webpack/babel ?

babel-node is not recommended for production. While node doesn’t support natively async/await, we need to transpile the code with babel. Webpack is not necessary in this boilerplate but having the server built in a single file is pretty awesome though.

License

MIT

Related Repositories

koa-babel-webpack-boilerplate

koa-babel-webpack-boilerplate

A simple boilerplate to create REST apps with koa2, babel and webpack ...

react-redux-webpack-boilerplate

react-redux-webpack-boilerplate

Boilerplate set up with Koa, React, Babel, ESLint, Redux, Sass, Bootstrap, Mocha, Chai, Webpack ...