null
Find a file
2022-11-01 00:35:25 +03:30
clients add clients 2022-11-01 00:01:48 +03:30
express change statusCode for when the database changes from 200 to 201 2022-11-01 00:23:05 +03:30
websocket implement websocket 2022-11-01 00:02:51 +03:30
.gitignore git init 2022-11-01 00:00:15 +03:30
README.md update README.md - fix typo 2022-11-01 00:35:25 +03:30

Basic NodeJS APIs

Basic implementation of NodeJS Express and Websocket with Clients for testing

Service Url Port
express APIs (list) /api/v1/list 3001
websocket /ws 8077

Express

run Express server

node src/server.js 

run Express client tests

tests are written using curl

bash clients/express/curl 

Websocket

run Websocket server

node src/server.js 

run Websocket client tests

bash clients/express/curl 

Generate a token in the jwt.io by using the following inputs:

HEADER: ALGORITHM & TOKEN TYPE

{
  "alg": "HS256",
  "typ": "JWT"
}

PAYLOAD: DATA

{
  "sub": "1",
  "username": "danial",
  "iat": 1516239022
}

VERIFY SIGNATURE

HMACSHA256(
  base64UrlEncode(header) + "." + 
  base64UrlEncode(payload),
  s3cu73-c0$3
)