I am working with an API and the API is redirecting me to localhost:3001/home
When it does, it also sends a token to use for any fetch calls. The url then looks something like:
I am trying to display the token just to check if i can access it but to no avail.
Can anyone tell me where im going wrong?
router.get('/home?:access_token', (req, res) => {
const token = req.param('access_token');
res.send(`The token is: ${token}`);
});
Ideally, I would like the page to display:
Your token is: zTeQkUQkUvTHYqCcmbdWKne04DXaXWur1ZMr0GGZLM_WlVnNBQDS7-sZJZ5tEEkg4Oa2DimoF67jGXJkNzUcw4YIM0WgBVum4yQkUvTHYqCcmbdWKne04DXaXWur1ZMr0GGZLM_WlVnNBQDS7-sZJZ5tEEkg4Oa2DimoF67jGXJkNzUcw4YIM0WgBVum4yOCQWGuqfMfzK60QAHJKDNBZT4-Py6rpbIE
Instead, I just get:
Your token is: e