UNPKG

win10-rocks

Version:

Build apps for Win10 using the winjs-rocks MVVM architecture

45 lines (35 loc) 1.15 kB
var express = require('express'), app = express(), compression = require('compression'), oneDay = 86400000, path = require('path'); //app.use(compression()); /* Include the app engine handlers to respond to start, stop, and health checks. */ // [START health_checks] express.Router().get('/_ah/health', function(req, res) { res.set('Content-Type', 'text/plain'); res.status(200).send('ok'); }); // [END health_checks] express.Router().get('/_ah/start', function(req, res) { res.set('Content-Type', 'text/plain'); res.status(200).send('ok'); }); express.Router().get('/_ah/stop', function(req, res) { res.set('Content-Type', 'text/plain'); res.status(200).send('ok'); process.exit(); }); app.get('/', function(req, res) { res.sendFile(path.join(__dirname + '/default.html')); }); app.use(express.static(__dirname, { maxAge: oneDay })); // [START server] /* Start the server */ var server = app.listen(process.env.PORT || '8080', '0.0.0.0', function() { console.log('App listening at http://%s:%s', server.address().address, server.address().port); console.log("Press Ctrl+C to quit."); }); // [END server]