This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var jwt = require('jwt-simple'); | |
| var config = require('yaml-config'); | |
| var settings = config.readConfig('./config/app.yaml'); | |
| var username = settings.rabbitmq.username; | |
| var password = settings.rabbitmq.password; | |
| var url = settings.rabbitmq.url; | |
| var port = settings.rabbitmq.port; | |
| var rpc = require('amqp-rpc').factory({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var router = express.Router(); | |
| var bodyParser = require('body-parser'); | |
| var jwtauth = require('../../../jwtauth.js'); | |
| router.get('/', [bodyParser(), jwtauth], function(req, res) { | |
| //jwtauth is run automatically and will populate req.user if there is a valid token supplied | |
| if(!req.user) { | |
| res.status(401).send({error: "Unauthorized access"}); | |
| return |
OlderNewer