- Express
- Node.js
- Typescript
- JsonWebToken
- Cookie-Parser
- Mongoose
- Use npm install to install all needed packages.
- Ensure default.ts file is property set up (jwt_private_key, jwt_public_key token_TTL and port, optional if you don't want to use a db comment or remove lines marked with remove for no db usage and leave db_key blank.)
-
Setting up Jwt Keys:
1. Generate a RSA key: https://travistidwell.com/jsencrypt/demo/ (use 2048 bit+)
2. Encode RSA key with base64: https://www.base64encode.org
3. Insert Public key and Private key in nessesary spot.
-
Run npm start to start the web server in files terminal
Routes: Domain(http://Localhost: (your port number in default file))
/api: Create new jwt token if none exist
/api/get: Will display Jwt information
/api/delete: Will delete token
To add more add them to the Routes.ts File in /src
Represntation of how the api should work.