"use strict";

/* Import libraries **********************************************************/

import * as express from 'express';
import * as winston from 'winston';

import * as hello from './hello';

/* Set up Winston for logging ************************************************/

let logger = new (winston.Logger)({
	transports: [
		new (winston.transports.Console)({
			timestamp: () => {
				return (new Date).toISOString();
			},
			handleExceptions: true
		})
	]
});

logger.info('Hello starting');

/* Set up doing something useful *********************************************/

let app = express();

app.get("/", (request, response) => {
	response.send(hello.greeting());
});

let server = app.listen(8080);

/* Set up exit handler *******************************************************/

process.on('exit', () => {
	logger.info('Hello stopping');

	if(server !== undefined) {
		server.close();
	}
});

process.on('SIGINT',  () => { process.exit(0); });
process.on('SIGTERM', () => { process.exit(0); });

/* Done, process held open by I/O ********************************************/

logger.info('Hello started');

"use strict";

/* Import libraries **********************************************************/

import * as express from 'express';
import * as winston from 'winston';

import * as hello from './hello';

/* Set up Winston for logging ************************************************/

let logger = new (winston.Logger)({
	transports: [
		new (winston.transports.Console)({
			timestamp: function() {
				return (new Date).toISOString();
			},
			handleExceptions: true
		})
	]
});

logger.info('Hello starting');

/* Set up doing something useful *********************************************/

let app = express();

app.get("/", function(request, response) {
	response.send(hello.greeting());
});

let server = app.listen(8080);

/* Set up exit handler *******************************************************/

process.on('exit', function() {
	logger.info('Hello stopping');

	if(server !== undefined) {
		server.close();
	}
});

process.on('SIGINT',  function() { process.exit(0); });
process.on('SIGTERM', function() { process.exit(0); });

/* Done, process held open by I/O ********************************************/

logger.info('Hello started');

--- 
+++ 
@@ -12,7 +12,7 @@
 let logger = new (winston.Logger)({
 	transports: [
 		new (winston.transports.Console)({
-			timestamp: function() {
+			timestamp: () => {
 				return (new Date).toISOString();
 			},
 			handleExceptions: true
@@ -26,7 +26,7 @@
 
 let app = express();
 
-app.get("/", function(request, response) {
+app.get("/", (request, response) => {
 	response.send(hello.greeting());
 });
 
@@ -34,7 +34,7 @@
 
 /* Set up exit handler *******************************************************/
 
-process.on('exit', function() {
+process.on('exit', () => {
 	logger.info('Hello stopping');
 
 	if(server !== undefined) {
@@ -42,8 +42,8 @@
 	}
 });
 
-process.on('SIGINT',  function() { process.exit(0); });
-process.on('SIGTERM', function() { process.exit(0); });
+process.on('SIGINT',  () => { process.exit(0); });
+process.on('SIGTERM', () => { process.exit(0); });
 
 /* Done, process held open by I/O ********************************************/
 
Switch anonymous functions to arrow syntax

It's a little cleaner, and has less surprising behaviour so is safer to
default to.
