Browse Source

server added

master
Christian Müller 11 years ago
parent
commit
9ed2df2c8f
  1. 2
      .gitignore
  2. 8
      package.json
  3. 0
      resources/public/index.html
  4. 0
      resources/public/style.css
  5. 17
      server.js

2
.gitignore vendored

@ -1,2 +1,4 @@
dump.rdb dump.rdb
bin/ bin/
node_modules/
npm-debug.log

8
package.json

@ -2,8 +2,9 @@
"name": "NoteHub", "name": "NoteHub",
"version": "3.0.0", "version": "3.0.0",
"description": "Free Pastebin for One-Off Markdown Publishing", "description": "Free Pastebin for One-Off Markdown Publishing",
"main": "index.html", "main": "server.js",
"scripts": { "scripts": {
"server": "node server.js",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"repository": { "repository": {
@ -19,5 +20,8 @@
"bugs": { "bugs": {
"url": "https://github.com/chmllr/NoteHub/issues" "url": "https://github.com/chmllr/NoteHub/issues"
}, },
"homepage": "https://github.com/chmllr/NoteHub" "homepage": "https://github.com/chmllr/NoteHub",
"dependencies": {
"express": "^4.13.3"
}
} }

0
index.html → resources/public/index.html

0
style.css → resources/public/style.css

17
server.js

@ -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);
});
Loading…
Cancel
Save