Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.
DecentralizeJusticePublic archive
forked from bcoin-org/bweb

About

This repo exist to merge https://github.com/bcoin-org/bweb/pull/7 without messing with node modules as here https://github.com/bcoin-org/bcoin/issues/728

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

43 Commits

Folders and files

Repository files navigation

bweb

A web server.

Usage

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, '<a href="/static">static</a>');
});

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. </legalese>

License

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

See LICENSE for more info.

About

This repo exist to merge https://github.com/bcoin-org/bweb/pull/7 without messing with node modules as here https://github.com/bcoin-org/bcoin/issues/728

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages