var express = require('express');
var port = process.env.PORT || 3333;
var app = express();

app.use(express.static(__dirname + '/dev/patterns'));

app.get('/', function (req, res) {
  res.sendFile('index.html');
});

app.listen(port);

var express = require('express');
var port = process.env.PORT || 3333;
var app = express();


// Controlling shutdown of nodemon
// https://github.com/remy/nodemon#controlling-shutdown-of-your-script
process.once('SIGUSR2', function () {
  process.kill(process.pid, 'SIGUSR2');
});

app.use(express.static(__dirname + '/dev/patterns'));

app.get('/', function (req, res) {
  res.sendFile('index.html');
});

app.listen(port);

Add process killer for controlling shutdown of nodemon When manually starting and stopping `npm run dev` script, which includes nodemon, the nodemon process doesn't always exit cleanly. This code (I think) controls the shutdown process so that there's always a clean exit