1.3.3 • Published 5 years ago

@deuterium/koa v1.3.3

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

@deuterium/koa

A package for quickstarting a koa server. Easy enough to start with one function, with ability to be flexible with use of koa-router for routes and input for added koa- applications.

Install

yarn add koa koa-router @deuterium/koa

Starting Up

import { initServer } from '@deuterium/koa'

...

const server = initServer(routing, extraPackages, options)

Routing

The first input to initServer is routing, which is a function with input of the koa-router.

An example of a routing function:

const routing = router => {
    router.get('/', ctx => {
        ctx.body = 'Hello World'
    })
}

Options

An object with various options:

  • silent (boolean) - If true, does not output to console.
  • port (number) - If port entered, overrides environment port.

Ex.

const options = {
    silent: false,
    port: 8000,
}
1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago