diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1118a8a --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* \ No newline at end of file diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..80b4959 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,25 @@ +var Hapi = require('hapi'); +var Hoek = require('hoek'); +var internals = require('../package.json'); + +var server = new Hapi.Server(); + +server.connection({ port: 8000 }); + +server.route({ + + method: 'GET', + path: '/version', + handler: function (request, reply) { + response = { + version: internals.version, + } + return reply(response); + } +}); + +server.start(function (err) { + + Hoek.assert(!err, err); + console.log('Hapi server started!', server.info.uri); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..87b655e --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "hueniversity", + "version": "0.0.1", + "description": "Hueversity turorials assignements repository", + "main": "lib/index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/hueniverse/hueniversity.git" + }, + "keywords": [ + "Hueversity", + "hapi", + "knowledge" + ], + "license": "BSD", + "bugs": { + "url": "https://github.com/hueniverse/hueniversity/issues" + }, + "dependencies": { + "hapi": "~8.4.0", + "hoek": "~2.11.1" + } +}