Skip to content

Commit

Permalink
feat: Add more logs (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmvilas authored Jun 10, 2020
1 parent 27ffc15 commit 1dadcf5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion template/src/api/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Hermes = require('hermesjs');
const app = new Hermes();
const { cyan, gray } = require('colors/safe');
const { cyan, gray, yellow } = require('colors/safe');
const buffer2string = require('./middlewares/buffer2string');
const string2json = require('./middlewares/string2json');
const json2string = require('./middlewares/json2string');
Expand All @@ -22,9 +22,11 @@ app.use(logger);
// Channels
{% for channelName, channel in asyncapi.channels() -%}
{% if channel.hasPublish() -%}
console.log(cyan.bold.inverse(' SUB '), gray('Subscribed to'), yellow('{{channelName}}'));
app.use({{ channelName | camelCase }});
{% endif -%}
{% if channel.hasSubscribe() -%}
console.log(yellow.bold.inverse(' PUB '), gray('Will eventually publish to'), yellow('{{channelName}}'));
app.useOutbound({{ channelName | camelCase }});
{% endif -%}
{% endfor %}
Expand Down

0 comments on commit 1dadcf5

Please sign in to comment.