Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bcoin-org/bweb

A better web server for node.js
https://github.com/bcoin-org/bweb

Last synced: 6 days ago
JSON representation

A better web server for node.js

Awesome Lists containing this project

README

        

# bweb

A web server.

## Usage

``` js
const bweb = require('bweb');
const server = bweb.server({
port: 8080,
sockets: true
});

server.on('socket', (socket) => {
// A bsock socket
socket.fire('hello', 'world');
});

server.use(server.bodyParser());
server.use(server.cookieParser());
server.use(server.jsonRPC());
server.use(server.router());
server.use('/static', server.fileServer(__dirname));

server.get('/', async (req, res) => {
res.html(200, 'static');
});

server.open();
```

## Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. ``

## License

- Copyright (c) 2017, Christopher Jeffrey (MIT License).

See LICENSE for more info.