Skip to content

Commit

Permalink
update/upgrade to the latest version of Hapi & Lab
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Feb 26, 2015
1 parent 8a37485 commit 5d51d68
Show file tree
Hide file tree
Showing 4 changed files with 323 additions and 197 deletions.
17 changes: 10 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// Start this app from your command line with: node hellovalidate.js
// then visit: http://localhost:3000/YOURNAME

var Hapi = require('hapi'),
Joi = require('joi'),
Boom = require('boom'); // Todo: add boom to the top of the file
var Hapi = require('hapi');
var Joi = require('joi');
var Boom = require('boom');
var port = 3000; // process.env.PORT || 3000; // allow port to be set by environment

var server = new Hapi.Server('0.0.0.0', 3000);

server.route({
var server = new Hapi.Server();
server.connection({ port: port });

server.route({
method: 'GET',
path: '/{yourname*}',
config: { // validate will ensure YOURNAME is valid before replying to your request
Expand All @@ -18,7 +21,7 @@ server.route({
}
});

server.route({
server.route({
method: 'GET',
path: '/photo/{id*}',
config: { // validate will ensure YOURNAME is valid before replying to your request
Expand All @@ -34,4 +37,4 @@ server.start(function() {
console.log('Now Visit: http://localhost:3000/YOURNAME')
});

module.exports = server;
module.exports = server;
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "learn-hapi",
"version": "0.0.1",
"version": "8.2.0",
"description": "Learn to build APIs using Hapi.js'",
"main": "index.js",
"scripts": {
"test": "./node_modules/lab/bin/lab -c && ./node_modules/lab/bin/lab -r html -o ./test/coverage.html"
"test": "./node_modules/lab/bin/lab -c && ./node_modules/lab/bin/lab -r html -o ./test/coverage.html",
"start": "node index.js"
},
"repository": {
"type": "git",
Expand All @@ -21,14 +22,15 @@
},
"homepage": "https://github.com/nelsonic/learn-hapi",
"dependencies": {
"hapi": "7.1.1",
"hapi": "^8.x.x",
"joi": "^4.7.0",
"socket.io": "^1.2",
"boom": "^2.6",
"bell": "^1.3.0",
"handlebars": "^2.0.0"
},
"devDependencies": {
"code": "^1.3.0",
"lab": "5.0.1"
}
}
Loading

0 comments on commit 5d51d68

Please sign in to comment.