pusudb-use-static-file
v1.0.7
Published
A static-file middleware for the pusudb-framework.
Downloads
9
Maintainers
Readme
pusudb-use-static-file
Middleware to serve static-files with the pusudb-framework.
This middleware adds a file-handler to the pusudb-framework to serve static files.
Framework: pusudb
Installing
npm install pusudb-use-static-file --save
Use
Define the path where the static-files are located. Define some url's which should be escaped. To define a url-prefix use the option prefix.
var Pusudb = require('pusudb')
var pusudb = new Pusudb(3000, 'localhost', { log : true })
var Static = require('pusudb-use-static-file')
// prefix '/css' : http://localhost:3000/css/main.css
var static = new Static(__dirname + '/node_modules/css', ['/db', /* blocked pathnames */], { prefix : '/css' })
//add the middleware to the pusudb
pusudb.use('http', static.serve)
pusudb.listen(function(port, host){
console.log('pusudb listening:', port, host)
})
Authors
- Yannick Grund - Initial work - yamigr
License
This project is licensed under the MIT License