Skip to content

Commit

Permalink
adds devDependency on inert plugin for serving static files. see: hap…
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Aug 14, 2015
1 parent a7cc833 commit 5cee845
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down
11 changes: 8 additions & 3 deletions static-server.js
Original file line number Diff line number Diff line change
@@ -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) });

0 comments on commit 5cee845

Please sign in to comment.