0.9.2 • Published 8 years ago

http-specific v0.9.2

Weekly downloads
-
License
CC-BY-SA-4.0
Repository
-
Last release
8 years ago

http-specific

library to serve http content from a specific directory as if it was the root directory of the server

Usage

const httpSpecific = require('http-specific');
const app = express();
httpSpecific({
    app: app,
    httpdir: "html", // the directory to be served - for absolute path start with '/'
    defaulthtml: "index.html" //optional. defaults to index.html
});

app.listen(3000);

After executing the lines above, the server will answer the following GET request: http://localhost:3000/somefile.html by servering the file from /your/node/app/html/somefile.html