Skip to content

Instantly share code, notes, and snippets.

@senthilmpro
Created March 28, 2019 04:25
Show Gist options
  • Save senthilmpro/4245b9921e2ce0cf50a53578fca52e1c to your computer and use it in GitHub Desktop.
Save senthilmpro/4245b9921e2ce0cf50a53578fca52e1c to your computer and use it in GitHub Desktop.
host local files serve-index
var express = require('express'),
directory = require('serve-index'),
app = new express();
var hourMs = 1000*60*60;
app.use(express.static(__dirname + '/public', { maxAge: hourMs }));
app.use(directory(__dirname + '/public', { 'view' : 'details'}));
app.listen(4433);
console.log("application running on : "+ 4433);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment