niode-middleware

1.0.1 • Public • Published

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]

Package Sidebar

Install

npm i niode-middleware

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

8.03 kB

Total Files

7

Last publish

Collaborators

  • niosz