From 55de18efb455086a6d91bb787bf3cbc86491a1d9 Mon Sep 17 00:00:00 2001 From: michaelryancaputo Date: Sun, 15 Mar 2015 18:07:38 -0400 Subject: [PATCH] Assignment #1 --- .gitignore | 2 ++ lib/index.js | 16 ++++++++++++++++ package.json | 14 ++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .gitignore create mode 100644 lib/index.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb79dd5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +.idea diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..a77f7eb --- /dev/null +++ b/lib/index.js @@ -0,0 +1,16 @@ +var Hapi = require('hapi'); +var server = new Hapi.Server(); +var pkg = require('../package.json'); +server.connection({ port: 8000 }); + +server.route({ + method: 'GET', + path: '/version', + handler: function (request, reply) { + reply({ version: pkg.version }); + } +}); + +server.start(function () { + console.log('Server version: ' + pkg.version + '. Port: ' + server.info.port + '.'); +}); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..c958211 --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "hueniversity", + "version": "0.0.1", + "description": "hueniversity solution", + "main": "lib/index.js", + "dependencies": { + "hapi": "^8.4.0" + }, + "devDependencies": {}, + "scripts": {}, + "author": "Michael Caputo", + "license": "ISC", + "homepage": "https://github.com/michaelryancaputo/hueniversity" +}