this repo has no description
1var Hapi = require('hapi');
2var Good = require('good');
3
4// Create a server with a host and port
5var server = new Hapi.Server();
6server.connection({
7 host: 'localhost',
8 port: 8000
9});
10
11// Add the route
12
13server.route({
14 method: 'GET',
15 path: '/webgl',
16 handler: function(request, reply) {
17 reply.file("webgl.html")
18 }
19});
20
21server.route({
22 path: "/assets/{param*}",
23 method: "GET",
24 handler: {
25 directory: {
26 path: "assets"
27 }
28 }
29});
30
31server.register([{
32 register: Good,
33 options: {
34 reporters: [{
35 reporter: require('good-console'),
36 args: [{
37 log: '*',
38 response: '*'
39 }]
40 }]
41 }
42}, {
43 register: require('./assets/js/plugins/socketio')
44}], function(err) {
45 if (err) {
46 //throw err; // something bad happened loading the plugin
47 }
48
49 server.start(function() {
50 server.log('info', 'Server running at: ' + server.info.uri);
51 });
52});