[TASK] Introduce basic files for nodejs.
This commit is contained in:
parent
4fb7991b8c
commit
1c5ddd7e82
|
@ -0,0 +1,5 @@
|
|||
node_modules
|
||||
snakeoil/*.pem
|
||||
snakeoil/*.csr
|
||||
settings.json
|
||||
!settings.json.template
|
|
@ -0,0 +1,2 @@
|
|||
.git*
|
||||
*.md
|
|
@ -0,0 +1,31 @@
|
|||
var express = require("express");
|
||||
var http = require("http");
|
||||
var https = require("https");
|
||||
var fs = require("fs");
|
||||
|
||||
var app = express();
|
||||
|
||||
app.use(function(req, res, next) {
|
||||
console.log("%s %s", req.method, req.url);
|
||||
next();
|
||||
});
|
||||
|
||||
//deliver static files by default
|
||||
app.use(express.static(__dirname + '/static'));
|
||||
|
||||
app.use("/ohai", function(req, res) {
|
||||
res.send("ohai!");
|
||||
});
|
||||
|
||||
|
||||
app.use(function(req, res) {
|
||||
res.status(404).send("Sorry, nothing here.");
|
||||
});
|
||||
|
||||
//http.createServer(app).listen(3000);
|
||||
|
||||
var httpsOptions = {
|
||||
"key": fs.readFileSync("snakeoil/privkey.pem"),
|
||||
"cert": fs.readFileSync("snakeoil/cert.pem")
|
||||
};
|
||||
https.createServer(httpsOptions, app).listen(3000);
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "dashboard",
|
||||
"version": "0.0.1",
|
||||
"description": "iGoogle-like dashboard",
|
||||
"keywords": [
|
||||
"web",
|
||||
"dashboard"
|
||||
],
|
||||
"repository": "git://github.com/JPT580/dashboard.git",
|
||||
"author": "Jan Philipp Timme <jan.philipp@timme.it>",
|
||||
"dependencies": {
|
||||
"express": "*"
|
||||
},
|
||||
"devDependencies": {},
|
||||
/*
|
||||
"licenses": [{
|
||||
"type": "MIT",
|
||||
"url": "https://raw.github.com/senchalabs/connect/master/LICENSE"
|
||||
}],
|
||||
*/
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node app.js"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue