diff --git a/package.json b/package.json index 0aed256..7cf03d2 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "codeclimate": "CODECLIMATE_REPO_TOKEN=7498136cff114e83c81fe6e2839f9538d865f9bdee4eb41d25d2058a9110713c ./node_modules/codeclimate-test-reporter/bin/codeclimate.js < ./coverage/lcov.info", "test": "node test.js", "coverage": "istanbul cover test.js", - "open-coverage":"open ./coverage/lcov-report/index.html", + "open-coverage": "open ./coverage/lcov-report/index.html", "start": "./node_modules/.bin/nodemon static-server.js", "docs": "./node_modules/jsdoc/jsdoc.js change.js", "open-docs": "open ./out/global.html#getChange" @@ -32,6 +32,7 @@ "devDependencies": { "codeclimate-test-reporter": "0.1.0", "hapi": "^9.0.1", + "inert": "^3.0.1", "istanbul": "^0.3.17", "jsdoc": "^3.3.2", "nodemon": "^1.4.1", diff --git a/static-server.js b/static-server.js index 833ff40..07f321d 100644 --- a/static-server.js +++ b/static-server.js @@ -1,4 +1,9 @@ -var Hapi = require('hapi'), Path = require('path'), server = new Hapi.Server(), port = process.env.PORT || 8000; +var Hapi = require('hapi'), Inert = require('inert'), Path = require('path'), +server = new Hapi.Server(), port = process.env.PORT || 8000; +server.register(Inert, function () {}); server.connection({ port: port }); -server.route( { method: 'GET', path: '/{param*}', handler: { directory: { path: Path.normalize(__dirname + '/') } } }); -server.start(function() { console.log('Static Server Listening on : http://127.0.0.1:' +port) }); +server.route( { method: 'GET', path: '/{param*}', handler: { + directory: { path: Path.normalize(__dirname + '/') } + } +}); +server.start(function() { console.log('Visit: http://127.0.0.1:' +port) });