Skip to content

Commit

Permalink
update express config, add demo config, ignore node_modules dir
Browse files Browse the repository at this point in the history
  • Loading branch information
pstoellberger committed Nov 14, 2013
1 parent b2d4e01 commit 24f8ed7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@ config.yaml
.project
.settings
archive
buffer
buffer
node_modules
9 changes: 5 additions & 4 deletions app.js
Expand Up @@ -34,19 +34,20 @@ try {
};
} catch (e) {}
var app = options === undefined ?
require('express').createServer() :
require('express').createServer(options);
express() :
express(options);
var bodyParser = express.bodyParser();

// Properly handle errors
/*
app.error(function(err, req, res, next) {
if (err instanceof SyntaxError) {
res.send({ error: 'Could not parse data' }, 415);
} else {
res.send({ error: 'Internal Server Error' }, 500);
}
});

*/
// Status page
app.all('/', function(req, res, next) {
telemetry.get_status(req, res, next);
Expand All @@ -62,4 +63,4 @@ app.post('/input', bodyParser, function(req, res, next) {
telemetry.bulk_load(req, res, next);
});

module.exports = app;
module.exports = app;
10 changes: 10 additions & 0 deletions demo.config.js
@@ -0,0 +1,10 @@
var config = {
"type" : "json",
"archive": "/tmp/telemetry/",
"buffer": "/tmp/telemetry/",
"input": "demo"
};

exports.inputs = {
demo: [ config ]
}

0 comments on commit 24f8ed7

Please sign in to comment.