-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
36 lines (27 loc) · 840 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var metro = require('./lib/metro');
var app = metro.createServer();
app.subscribe('testexchange/test.route/testqueue', 'workflow1', function(workflow) {
workflow.http('stepone', function(req, res) {
console.log('stepone invoked');
console.log(req.body);
res.write('responseone', 'oh yeah!');
res.next('steptwo');
});
workflow.log('steptwo', function(req, res) {
console.log('steptwo invoked');
console.log(req.body);
res.write('responsetwo', 'oh yes!');
res.next('stepthree', 'test');
});
workflow.http('stepthree', function(req, res) {
console.log('stepthree invoked');
console.log(req.body);
res.write('responsethree', 'oh man!');
res.next('stepfour', 'test');
});
workflow.code('stepfour', function(req, res) {
console.log('stepfour invoked');
console.log(req.body);
});
});
app.listen();