1.0.4 • Published 1 year ago
express-static-plus v1.0.4
express-static-plus
usage :
//derectory of static server,extra variabals
function staticPlus(dir = __dirname+'/static',variabals = {}){}
var staticPlus = require('express-static-plus')
var express = require('express')
var app = express()
app.use(staticPlus(__dirname+'/test',{passed_data:"hello world"}))
app.listen(8080)
variables request and response will be available in scripts to handle the incoming request and response. same as app.get(req,res) response
if file ends with .jade, .ejs or any valid render engine file ending, it will automaticly render using the appropriate render engine
all normal files under directory will be handled with "response.sendFile".
file extension index list:
.ejs -- will render with ejs .jade -- will render with jade .mustache -- will render with mustache .dust -- will render with dustjs .njk -- will render with nunjucks .pug -- will render with pug