Example #1
0
runner.test('simple', async function () {
  const port = 8000 + this.index
  const lws = new Lws()
  const server = lws.listen({
    port,
    stack: Blacklist,
    blacklist: '/one'
  })
  const response = await request(`http://localhost:${port}/one`)
  const response2 = await request(`http://localhost:${port}/two`)
  server.close()
  a.strictEqual(response.res.statusCode, 403)
  a.strictEqual(response2.res.statusCode, 404)
})
Example #2
0
runner.test('simple', async function () {
  const port = 8000 + this.index
  const lws = new Lws()
  const server = lws.listen({ port, stack: Log, logFormat: 'combined' })
  const response = await request(`http://localhost:${port}/`)
  server.close()
})