5.0.1 • Published 8 years ago

server.app-builder v5.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

server.app-builder

install: npm install server.app-builder

An abstraction over the http.Server class that uses promise-based middleware

import { Server } from 'server.app-builder'

const app = new Server()

app.use(async (env, next) => {
  let start = Date.now()
  await next()
  env.res.end('Hello World')
  console.log(`request took ${Date.now() - start} milliseconds`)
})

app.listen(8080)
  .then(() => console.log('Listening on port 8080'))

The argument passed to the middleware functions includes req and res properties. Which are instances of http.IncomingMessage and http.ServerResponse respectively. The argument can be modified arbitrarily by the middleware functions and is created per request.

The module has two named exports: Server and Context; and the default export -- a factory for creating Server instances

5.0.1

8 years ago

5.0.0

8 years ago

4.2.3

8 years ago

4.2.2

8 years ago

4.2.1

8 years ago

4.2.0

8 years ago

4.1.1

8 years ago

4.1.0

8 years ago

4.0.6

8 years ago

4.0.5

8 years ago

4.0.4

8 years ago

4.0.3

8 years ago

4.0.2

8 years ago

4.0.1

8 years ago

4.0.0

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.0

8 years ago

3.0.0

9 years ago

2.1.3

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.2.0

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago