Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/bcoin-org/bweb
- Owner: bcoin-org
- License: other
- Created: 2017-10-22T12:47:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T06:17:54.000Z (9 months ago)
- Last Synced: 2024-10-20T05:44:32.264Z (24 days ago)
- Language: JavaScript
- Size: 147 KB
- Stars: 13
- Watchers: 9
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.