Skip to content

Commit

Permalink
Tweaking event processing
Browse files Browse the repository at this point in the history
  • Loading branch information
cressie176 committed Apr 12, 2014
1 parent 721b126 commit f7febf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "defcon-rest-gateway",
"version": "0.2.0",
"version": "0.2.1",
"description": "Gateway for RESTful events",
"main": "plugin.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions plugin.js
Expand Up @@ -25,7 +25,7 @@ function create(context, next) {
if (!req.body.type) return res.send(400, 'A type is required\n');

var event = {
id: uuid.v1(),
id: req.body.id || uuid.v1(),
severity: /^[1-5]$/.test(req.body.severity) ? req.body.severity : 1,
system: req.body.system,
group: req.body.group,
Expand All @@ -35,7 +35,7 @@ function create(context, next) {
timestamp: req.body.timestamp || new Date(),
message: req.body.message,
link: req.body.link,
format: 'defcon/v1'
format: req.body.format || 'defcon/v1'
}

process.nextTick(function() {
Expand Down

0 comments on commit f7febf2

Please sign in to comment.