niode-middleware
v1.0.1
Published
Enable express automatic handling for Pug, SCSS and Babel all in one
Downloads
2
Maintainers
Readme
niode-middleware
Enable express automatic handling for Pug, SCSS and Babel all in one, included a full server example.
Usage
var rootPath = process.argv[1];
rootPath = rootPath.substr(0,rootPath.length-9);
const express = require("express");
const app = express();
const niodeMiddleware = require("niode-middleware");
app.use("/",niodeMiddleware({rootPath:rootPath+"public",debug:true}));
app.use(express.static("public"));
var port = 1982;
if (process.argv.length>=2)
{var isanumber=parseInt(process.argv[2]);
if(isanumber!==NaN&&isanumber>0)port=isanumber;}
app.listen(port,()=>console.log("demo server started on port "+port));
Included Demo
npm start [port]