DefinitelyTyped/hapi/hapi-tests.ts
Jakub Olek 60bc96cefb I have no idea how to do union types for properties
and how to use node modules
2014-08-25 14:23:53 +02:00

27 lines
501 B
TypeScript

/// <reference path="hapi.d.ts" />
import Hapi = require('hapi');
// Create a server with a host and port
var server = Hapi.createServer('localhost', 8000);
// Add the route
server.route({
method: 'GET',
path: '/hello',
handler: function (request: Hapi.Request, reply: Function) {
reply('hello world');
}
});
server.route([{
method: 'GET',
path: '/hello2',
handler: function (request: Hapi.Request, reply: Function) {
reply('hello world2');
}
}]);
// Start the server
server.start();