Skip to content

Instantly share code, notes, and snippets.

@oinume
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oinume/9053999 to your computer and use it in GitHub Desktop.
Save oinume/9053999 to your computer and use it in GitHub Desktop.
A simple express application with TypeScript.
import express = require('express');
import http = require('http');
var app = express();
app.set('port', process.env.PORT || 3000);
app.get('/', function(req: express.Request, res: express.Response) {
res.send('Hello world!');
});
http.createServer(app).listen(app.get('port'), function() {
console.log('Express server listening on port ' + app.get('port'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment