@sharyn/koa
[![npm](https://img.shields.io/npm/v/@sharyn/koa.svg)](https://www.npmjs.com/package/@sharyn/koa)
Last updated 5 months ago by sharyn .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @sharyn/koa 
SYNC missed versions from official npm registry.

???? @sharyn/koa

npm

This package provides a Koa server.

???? Install

Minimal:

yarn add @sharyn/koa koa koa-router

Full-featured:

yarn add @sharyn/koa koa koa-router koa-mount koa-static koa-favicon koa-compress

???? Usage

startServer, stopServer

import { startServer, stopServer } from '@sharyn/koa'

const routing = router => {
  router.get('*', ctx => {
    ctx.body = `<!doctype html>
    <html>
      <body>
        Hello world!
      </body>
    </html>`
  })
}

startServer(routing) // Starts server on port PORT of your env, defaulting to 8000


// Mute the output with the silent option or change the port in your tests:
setup = () => startServer(routing, { port: 6000, silent: true })
teardown = () => stopServer({ port: 6000, silent: true })

Current Tags

  • 2.2.6                                ...           latest (5 months ago)

58 Versions

  • 2.2.6                                ...           5 months ago
  • 2.2.5                                ...           a year ago
  • 2.2.4                                ...           a year ago
  • 2.2.3                                ...           a year ago
  • 2.2.2                                ...           a year ago
  • 2.2.1                                ...           a year ago
  • 2.2.0                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.15.0                                ...           a year ago
  • 1.14.5                                ...           a year ago
  • 1.14.3                                ...           a year ago
  • 1.14.2                                ...           a year ago
  • 1.14.1                                ...           a year ago
  • 1.14.0                                ...           a year ago
  • 1.13.0                                ...           a year ago
  • 1.12.1                                ...           a year ago
  • 1.12.0                                ...           a year ago
  • 1.11.1                                ...           a year ago
  • 1.11.0                                ...           a year ago
  • 1.10.2                                ...           a year ago
  • 1.10.1                                ...           a year ago
  • 1.10.0                                ...           a year ago
  • 1.9.1                                ...           a year ago
  • 1.9.0                                ...           a year ago
  • 1.8.4                                ...           a year ago
  • 1.8.3                                ...           a year ago
  • 1.8.2                                ...           a year ago
  • 1.8.1                                ...           a year ago
  • 1.8.0                                ...           a year ago
  • 1.7.0                                ...           a year ago
  • 1.6.0                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.7                                ...           a year ago
  • 1.4.6                                ...           a year ago
  • 1.4.5                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.2                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |