JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 505
  • Score
    100M100P100Q85757F
  • License MIT

Web bike-shed

Package Exports

  • bweb
  • bweb/lib/middleware/index
  • bweb/lib/middleware/index-browser.js
  • bweb/lib/route
  • bweb/lib/server
  • bweb/lib/server-browser.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bweb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.