Skip to content

serviejs/servie-http

Repository files navigation

Servie Http

NPM version NPM downloads Build status Test coverage

Servie transport for HTTP(s).

Installation

npm install servie-http --save

Usage

import { createServer } from 'http'
import { createHandler } from 'servie-http'
import { get } from 'servie-route'

const handler = createHandler(get('/test', (req) => {
  return new Response({ statusCode: 200 }))
})

createServer(handler).listen(3000)

CLI

servie-http -f index.js -p 4000

servie-http --help

TypeScript

This project is written using TypeScript and publishes the definitions directly to NPM.

License

Apache 2.0