Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

Create basic server #25

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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.*
30 changes: 30 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var Hapi = require('hapi');
var Package = require('../package.json');
var Hoek = require('hoek');

//Declare internals

var internals = {
version: Package.version
};

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

server.route({
method: 'GET',
path: '/version',
config: {
handler: function (request, reply) {

return reply({ version: internals.version });
},
description: 'Get the version of the server'
}
});

server.start(function (err) {

Hoek.assert(!err, err);
console.log('Server running at:', server.info.uri);
});
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "hueniversity",
"version": "0.0.1",
"description": "\"This is a community learning experiment. The idea is simple - use GitHub as a platform for teaching people coding skills as a group, where everyone is both a student and a teacher. The goal is to learn how to operate such a distributed classroom and then apply that pattern to other topics by other people.\"",
"main": "./lib/index.js",
"scripts": {
"start": "node ./lib/index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/hueniverse/hueniversity.git"
},
"dependencies": {
"hapi": "^8.4.0",
"hoek": "~2.11.1"
}
}