This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
open = require('open'), | |
compression = require('compression'), | |
serveIndex = require('serve-index'), | |
serveStatic = require('serve-static'), | |
app = express(), | |
port = process.env.PORT || 8888, | |
sapui5 = '/sapui5', | |
url = 'http://localhost:' + port + sapui5, // + "/latest"; | |
year = 60 * 60 * 24 * 365 * 1000; | |
// Use compress middleware to gzip content | |
app.use(compression()); | |
//set default mime type to xml for ".library" files | |
express.static.mime.default_type = "text/xml"; | |
// Serve up content directory showing hidden (leading dot) files | |
app.use(sapui5, serveStatic(__dirname, { | |
maxAge: year, | |
dotfiles: 'allow' | |
})); | |
// enable directory listening | |
app.use(sapui5, serveIndex(__dirname)); | |
app.listen(port); | |
open(url); //open in default browser | |
console.log("Static file server running at\n => " + url + " \nCTRL + C to shutdown"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment