I’ve been searching the Internet for over a year now. I may not have the right keywords.
I have the following setup:
- ExpressJS API (works with pm2 on port 3000)
- Angular2 application - filed via nginx
Both run on the same server.
Calls to api (mydomain / api /) are proxied to 127.0.0.1:3000
For api calls requiring authorization, I will use JWT and user authentication.
What I want to achieve is that I generate a token for my angular2 application, which is allowed / required for public calls (e.g. product lists).
This token must be reliably transmitted, of course, since I do not want others to receive my products and prices using direct api calls (with a stolen token).
Any help was appreciated.
source share