This is a test REST API for JWT Login.
JWT Token will be refreshed in every 30 seconds.
Endpoints /api ->
- /auth ->
- POST /login
- POST /register
- POST /logout
- GET /refresh
- /user ->
- GET /info
If you want to run this backend in your local machine, please follow these instructions.
- Download source code, it'll have some missing points for security reasons.
- Create your own JWT Secret Key from this link. https://jwt.io/
- Create your own MongoDB Database. I've used MongoDB Atlas.
- Create .env file.
- You'll need to add 5 environment variables,
- BASE_URI = "YOUR URI, in my case it's jwt-test-api.onrender.com"
- MONGO_ATLAS_URI = "Local or Hosted MongoDB URI"
- JWT_SECRET_KEY = "Your JWT Secret Key"
- ENV = "Production" This one is optional, if you are going to work locally, you don't need this.
That's it.