To run this application locally, you have one dependency:
- Node.JS
Environment variables:
PORT: port on which the application will listen
LOG_LEVEL: Morgan middleware logger level, options: ["combined", "common", "dev", "short", "tiny"]
NODE_ENV: development or production? Production will not show Swagger-UI Documentation. "prod" for production, anything else will default to development
DATABASE_URI: mongo database connection string
CONNECTIONSTRING: Azure Web PubSub instance connection string
PUBSUBHUB: Azure Web PubSub hub to receive real-time notifications
To run the application:
-open a terminal window
-move to the application root directory
-(optional) execute the command "npm run coverage" to generate tsoa routes and run the unit tests
-execute the command "npm run build" to generate tsoa routes
-execute the command "npm run start" to start the application
There is an instance of this application deployed in Azure. These are the web-api endpoints:
-https://usernotification23771.azurewebsites.net/notification/accesstoken (Post)
-https://usernotification23771.azurewebsites.net/notification/user (Post)
-https://usernotification23771.azurewebsites.net/notification/all (Post)
-https://usernotification23771.azurewebsites.net/user/getallusers (Get)
-https://usernotification23771.azurewebsites.net/user/getuserbyid/{id} (Get)
-https://usernotification23771.azurewebsites.net/user (Post)
-https://usernotification23771.azurewebsites.net/user (Delete)
Swagger-UI: https://usernotification23771.azurewebsites.net/docs
To connect a WebSocket to the backend, use the JS script in the file './subPubSubWebsocketScript.js'.
To get an access token, use the endpoint '../notification/accesstoken'.