npm install
npm run serve
- Copy and rename .env.default to .env
- Add your parameter
- Note: Checked in the .env file. Passwords can be changed
Create your public and private key for the JWT signature:
$ openssl genrsa -out config/jwt/private.pem -aes256 4096
$ openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
- JWT Authentification with PEM file based signature and passphrase
- API Routes for registration and login
#API
- Requires
name
,email
andpassword
secret
can be passed to createAdmin
user
- Requires
email
andpassword
- Returns a
JWT
token
- Requires
Authorization
header with aBearer
token - Returns list of candidates
- If user is
Admin
total votes for each candidate comes - If user is
Non-Admin
his/her previous votes are returned
- Only
Admin
user ca create a candidate - Returns the
id
of the newly created candidate - Requires a
candidateName
- Only
Non Admin
user can vote - A user can only vote once