Namibian Pyjama Merchant
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    boot-webpublic

    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

    install

    npm i boot-web

    Downloadsweekly downloads

    7

    version

    1.0.2

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar