pearmini / toy-koa

A simple version of Koa for study purpose🦁

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toy Koa

This a simple version of Koa. It is just for learning purpose which can't be used directly in a production environment.

Get Started

const ToyKoa = require('./toy-koa/app.js');
const app = new ToyKoa();

app.use(ctx => {
    ctx.body = 'Hello ToyKoa';
})

app.listen(3000);

API

  • new ToyKoa()
  • app.use(callback: (ctx, next) => {})
  • app.listen(port, address, callback)

About

A simple version of Koa for study purpose🦁


Languages

Language:JavaScript 100.0%