boot-web

1.0.2 • Public • Published

boot-web

A mini web server with nodejs.

example:



    const BootWeb = require('boot-web');
    
    const EjsTest = require('./EjsTest');
    const RegRouteTest = require('./RegRouteTest');
    
    let web = new BootWeb.Boot();
    
    // webServer.setTemplate('ejs');
    // webServer.setTemplateRoot(path.join(__dirname, 'view/tpls'));
    
    web.use(new BootWeb.BaseAuth());
    web.use(new BootWeb.QueryString());
    web.use(new BootWeb.Cookie());
    web.use(new BootWeb.Session());
    web.use(new BootWeb.Static());
    web.use(new BootWeb.BodyParser());
    
    //app.use('/users/:name', new RouteTest());
    web.use('/photo/:up', new RegRouteTest());
    web.get('/test/', new EjsTest());
    
    web.listen(3015);

visit http://localhost:3015 to see the static index page.

http://localhost:3015/photo/yzg to test the regular expression route match

http://localhost:3015/test/ to test the ejs template file rendering

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    2
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i boot-web

Weekly Downloads

4

Version

1.0.2

License

MIT

Last publish

Collaborators

  • stanley.yao