Answer the question
In order to leave comments, you need to log in
How to transfer the connected library to the exports module?
Hello, There are 2 files, one is in the main one to which all libraries are connected, and there is a file with a separately rendered module, how can I transfer the library to the rendered module?
var express = require('express');
var bodyParser = require('body-parser');
var jwt = require('jsonwebtoken');
var app = express();
module.exports = function(app, jwt) {
app.post('/decode', (req, res) => {
var token = req.body.token;
var decoded = jwt.decode(token, {complete: true});
console.log(decoded.header);
console.log(decoded.payload);
res.json({
header: decoded.header,
payload: decoded.payload
});
});
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question