API

ream(options)

const ream = require('ream')
const config = require('./ream.config')

const app = ream({
  dev: process.env.NODE_ENV !== 'production',
  ...config
})

You can use all config options except those marked as CLI only.

There's an addtional option dev: boolean to indicate whether it's production build for not.

app.getRequestHandler()

  • Type: () => Promise<requestListener>

Get a requestListener function for the http.createServer call:

app.getRequestHandler()
  .then(handle => {
    const server = http.createServer((req, res) => {
      handle(req, res)
    })

    server.listen(3000)
  })

app.build()

  • Type: () => Promise<void>

Run webpack build.

app.start()

  • Type: () => http.Server

Start a server listening for connections.