IMPORTANT: THIS REPOSITORY IS OPTIMIZED FOR CODESPACES AND TO WORK AS A SET OF COMPOSABLE APPS AND APIS. STANDALONE PACKAGE FUNCTIONALITY IS LIMITED AND MAY REQUIRE ADDITIONAL CONFIGURATION OR DEVELOPMENT
This document will guide you through the prerequisites and commands necessary to setup the Realtime notification feature for the Portal project.
It will also instruct you how to deploy and publish it to the cloud.
IMPORTANT: THIS SCENARIO IS TIGHTLY COUPLED WITH SCENARIO 2. SOME PARTS OF THIS APP MAY NOT WORK AS EXPECTED IF YOU DON'T FOLLOW THE INSTRUCTIONS IN SCENARIO 2.
In order to enable and try out the realtime notification feature, you will need to:
- Create a Web PubSub For Socket.IO resource.
- Click
key
tab in resource portal, copy connection string. - Rename
.env.example
underpackages/notifications/
to.env
. Then fill in copied connection string to variableSERVICE_WEB_PUBSUB_CONNECTION_STRING
- From the
Client URL Generator
section, copy the Client Endpoint (e.g.https://<resource-name>.webpubsub.azure.com
) and Client Path (e.g./clients/socketio/hubs/Hub
) and update theSERVICE_WEB_PUB_SUB_URL
andSERVICE_WEB_PUB_SUB_PATH
in./packages/portal/.env
file.
- Assuming you are in
./packages/notifications
, run:
npm install
- Start the server by running:
npm start
The notification server should be running and functional. You should be able to see the logs in the terminal.