server added

This commit is contained in:
Christian Müller
2015-08-15 21:25:29 +02:00
parent eaf9786c42
commit 9ed2df2c8f
5 changed files with 25 additions and 2 deletions
+2
View File
@@ -1,2 +1,4 @@
dump.rdb
bin/
node_modules/
npm-debug.log
+6 -2
View File
@@ -2,8 +2,9 @@
"name": "NoteHub",
"version": "3.0.0",
"description": "Free Pastebin for One-Off Markdown Publishing",
"main": "index.html",
"main": "server.js",
"scripts": {
"server": "node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
@@ -19,5 +20,8 @@
"bugs": {
"url": "https://github.com/chmllr/NoteHub/issues"
},
"homepage": "https://github.com/chmllr/NoteHub"
"homepage": "https://github.com/chmllr/NoteHub",
"dependencies": {
"express": "^4.13.3"
}
}
+17
View File
@@ -0,0 +1,17 @@
var express = require('express');
var app = express();
/*
app.get('/', function (req, res) {
res.send('Hello World!');
});
*/
app.use(express.static(__dirname + '/resources/public'));
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('NoteHub server listening at http://%s:%s', host, port);
});