This repository was archived by the owner on Oct 26, 2019. It is now read-only.
forked from outmoded/university
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use strict'; | ||
|
||
// Index for basic http server | ||
|
||
// Dependencies | ||
|
||
var Hapi = require('hapi'); | ||
|
||
|
||
// Internal links | ||
var internals = { | ||
pkg: require('./package.json') | ||
} | ||
|
||
// Create a server | ||
var server = new Hapi.Server(); | ||
|
||
|
||
// Creates a connection | ||
|
||
server.connection({ port: process.env.PORT || 8000 }); | ||
|
||
// Routes | ||
|
||
|
||
server.route({ | ||
method: 'GET', | ||
path: '/version', | ||
handler: function(request, reply){ | ||
|
||
// Return the version of the application | ||
|
||
return reply({ verison: internals.pkg.version }); | ||
} | ||
}); | ||
|
||
|
||
server.start(function(err){ | ||
if (err){ | ||
|
||
throw err; | ||
} | ||
|
||
// Log the running server | ||
console.log('Server is running at ' + server.info.uri); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "hueniviersity", | ||
"version": "0.0.1", | ||
"description": "Communitiy learning experiment", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node index.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/hueniverse/hueniversity.git" | ||
}, | ||
"keywords": [ | ||
"hapi", | ||
"hapijs" | ||
], | ||
"author": "Community", | ||
"bugs": { | ||
"url": "https://github.com/hueniverse/hueniversity/issues" | ||
}, | ||
"homepage": "https://github.com/hueniverse/hueniversity", | ||
"dependencies": { | ||
"hapi": "^8.3.1" | ||
} | ||
} |