Skip to content

Instantly share code, notes, and snippets.

@rubinovitz
Created April 19, 2015 22:46
Show Gist options
  • Save rubinovitz/a4f724281e64359b22c5 to your computer and use it in GitHub Desktop.
Save rubinovitz/a4f724281e64359b22c5 to your computer and use it in GitHub Desktop.
app.js for node.js elasticbeanstalk
var express = require('express');
var morgan = require('morgan');
var compression = require('compression')
var app = express();
app.use(compression());
app.use(morgan('dev'));
// this is in milliseconds, because javascript -_-
var oneDay = 86400000;
app.use(express.static("" + __dirname + "/dist", { maxAge: oneDay }));
app.listen(process.env.PORT || 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment