Skip to content

a-labo/akoa

Repository files navigation

akoa

Build Status npm Version JS Standard

Async wrapper for koa server

Installation

$ npm install akoa --save

Usage

#!/usr/bin/env node

/**
 * This is an example to run akoa server
 */
'use strict'

const akoa = require('akoa')

void async function () {
  const server = await akoa([
    // Koa middleware
    async function middleware01 (ctx, next) {
      /* ... */
      await
        next()
    }
  ]).listen(3000)

  /* ... */

  await server.close()

}().catch((err) => console.error(err))

License

This software is released under the MIT License.

Links