cycle-http-context-driver
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.4 • Public • Published

cycle-http-context-driver

In alpha.

A HTTP server driver for CycleJS for managing request/response in Node.js.

Installation

npm install cycle-http-context-driver --save

Documentation

Usage

import {
  makeHTTPTransport,
  makeHTTPContextDriver
} from 'cycle-http-context-driver'
 
import bunyan from 'bunyan'
 
const logger = bunyan.createLogger({name: 'web'})
const transport = makeHTTPTransport()
 
const drivers = {
  HTTPContext: makeHTTPContextDriver(port, logger, transport)
}
 
function main (sources) {
  return {
    HTTPContext: sources.HTTP.map((context) => {
      return {
        ...context,
        headers: {'Content-Type': 'text/html'},
        body: 'Hello, world!'
      }
    })
  }
}
 
run(main, drivers)

Readme

Keywords

none

Package Sidebar

Install

npm i cycle-http-context-driver

Weekly Downloads

1

Version

0.0.1-alpha.4

License

MIT

Last publish

Collaborators

  • mariuslundgard