Koa Web Framework

3.2.0 · active · verified Sat Apr 18

Koa is an expressive HTTP middleware framework for Node.js, designed to build web applications and APIs. It emphasizes a small core, relying on its middleware stack for functionality, and does not bundle any middleware. The current stable version is 3.2.0, with active development across both v2 and v3 branches, indicating a continuous release cadence.

Common errors

Warnings

Install

Imports

Quickstart

A basic Koa server that listens on port 3000 and responds with 'Hello Koa' to all requests.

import Koa from 'koa';

const app = new Koa();

// response
app.use(ctx => {
  ctx.body = 'Hello Koa';
});

app.listen(3000, () => {
  console.log('Koa server listening on port 3000');
});

view raw JSON →