Skip to content
Lloyd Brookes edited this page Jun 18, 2019 · 17 revisions

Please see the lws API docs. The local-web-server programmatic API is identical to lws, the only difference being that local-web-server has a default stack while lws does not.

Trival example:

const LocalWebServer = require('local-web-server')
const ws = LocalWebServer.create({
  port: 9000,
  directory: 'public'
})

/* make requests */
// curl http://localhost:9000

/* shut down */
ws.server.close()
Clone this wiki locally