All Projects → romualdr → koa-babel-webpack-boilerplate

romualdr / koa-babel-webpack-boilerplate

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to koa-babel-webpack-boilerplate

graphql-ufc-api
GraphQL server for UFC's public API
Stars: ✭ 26 (-44.68%)
Mutual labels:  koa
tie
🧶A Node.js Framework based on TypeScript and Express.
Stars: ✭ 30 (-36.17%)
Mutual labels:  koa
midwayjs-crud
基于 Typescript+MidwayJs+Nacos 的微服务开发架构
Stars: ✭ 45 (-4.26%)
Mutual labels:  koa
koa-xml-body
koa middleware to parse xml request body
Stars: ✭ 36 (-23.4%)
Mutual labels:  koa
koa-session-mongoose
Mongoose store for Koa sessions
Stars: ✭ 29 (-38.3%)
Mutual labels:  koa
deploy
Used to deploy project, includes webhooks.
Stars: ✭ 15 (-68.09%)
Mutual labels:  koa
koa-react-redux-universal-boilerplate
[Unmaintained] A fullstack Koa + React + Redux Universal Boilerplate to speed up your development process.
Stars: ✭ 22 (-53.19%)
Mutual labels:  koa
shopify-node-react-app
Shopify paid app in Node.js & React.js that connects to a store and lets merchants select products to automatically discount them in the Shopify admin interface.
Stars: ✭ 29 (-38.3%)
Mutual labels:  koa
nodejs-koa-blog
基于 Node.js Koa2 实战开发的一套完整的博客项目网站
Stars: ✭ 1,611 (+3327.66%)
Mutual labels:  koa
rncms
🔥 Rncms 是基于 Koa2 + Webpack4 + Reactjs 结构简单 Cms 易于开发企业站和文档系统【已废弃】
Stars: ✭ 52 (+10.64%)
Mutual labels:  koa
tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 2,350 (+4900%)
Mutual labels:  koa
web-onefx-boilerplate
Full-stack React Framework for building web and backend
Stars: ✭ 34 (-27.66%)
Mutual labels:  koa
aws-serverless-koa
This library enables you to utilize AWS Lambda and Amazon API Gateway to respond to web and API requests using the Koa.js application framework
Stars: ✭ 37 (-21.28%)
Mutual labels:  koa
aotoo-hub
aotoo-hub是一套通用型前端脚手架,无技术栈依赖,聚焦于多人协作及工程化。帮助开发者快速产出项目。支持react/vue/小程序/node
Stars: ✭ 74 (+57.45%)
Mutual labels:  koa
koa-better-error-handler
A better error-handler for Lad and Koa. Makes `ctx.throw` awesome (best used with koa-404-handler)
Stars: ✭ 51 (+8.51%)
Mutual labels:  koa
js
serverless your express/koa/restify apps
Stars: ✭ 21 (-55.32%)
Mutual labels:  koa
koahub-cli
KoaHub CLI -- KoaHub.js的开发工具,自动babel编译 ES6/7(Generator Function, Class, Async & Await)并且文件修改后自动重启。
Stars: ✭ 16 (-65.96%)
Mutual labels:  koa
koa2-proxy
基于koa@next的代理工具,支持http和https,并且可以当做本地服务器使用
Stars: ✭ 42 (-10.64%)
Mutual labels:  koa
fullstack-playground
Monorepo playground with GraphQL Server, Rest API Server, typescript config, test utils, jest config, webpack and more
Stars: ✭ 47 (+0%)
Mutual labels:  koa
back-boilerplate
A boilerplate for building RESTful APIs using Node.js, PostgreSQL, koa, knex, bookshelf.
Stars: ✭ 33 (-29.79%)
Mutual labels:  koa

koa-babel-webpack-boilerplate

A simple boilerplate to create REST apps with

  • koa@next (currently 2.0.0-alpha.3)
  • babel (for async, await and stage-2 support)
  • webpack

How to use

Boilerplate is packed with koa-router@next in order to have a routing system.

Install development dependencies

npm i

Create a route

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

Run development

npm run development

Build

npm run build

Run the built version

node bin/server.bundle.js
// or
npm run run

Distribute and run the built file

npm i --production // to avoid dev dependencies
npm run run

### 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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].