Skip to content

Commit 8f922ef

Browse files
authored
Merge pull request #194609 from PorterNan/patch-1
Update chat-hero-sample.md using new nodejs server
2 parents dd46a41 + 7d1bde7 commit 8f922ef

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

articles/communication-services/samples/chat-hero-sample.md

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,10 @@ Below you'll find more information on prerequisites and steps to set up the samp
5050

5151
## Prerequisites
5252

53+
- [Visual Studio Code (Stable Build)](https://code.visualstudio.com/download)
54+
- [Node.js (16.14.2 and above)](https://nodejs.org/en/download/)
5355
- Create an Azure account with an active subscription. For details, see [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
54-
- [Node.js (8.11.2 and above)](https://nodejs.org/en/download/)
55-
- [Visual Studio (2017 and above)](https://visualstudio.microsoft.com/vs/)
56-
- [.NET Core 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1) (Make sure to install version that corresponds with your visual studio instance, 32 vs 64 bit)
57-
- Create an Azure Communication Services resource. For details, see [Create an Azure Communication Services resource](../quickstarts/create-communication-resource.md). You'll need to record your resource **connection string** for this quickstart.
58-
59-
## Locally deploying the service & client app
60-
61-
The single threaded chat sample is essentially two "applications" a client and server application.
62-
63-
Open up Visual Studio on the chat.csproj and run in Debug mode, this will start up the chat front end service. When the server app is visited
64-
from the browser, it will redirect traffic towards the locally deployed chat front end service.
65-
66-
You can test the sample locally by opening multiple browser sessions with the URL of your chat to simulate a multi-user chat.
56+
- Create an Azure Communication Services resource. For details, see [Create an Azure Communication Resource](../quickstarts/create-communication-resource.md). You'll need to record your resource **connection string** for this quickstart.
6757

6858
## Before running the sample for the first time
6959

@@ -72,22 +62,24 @@ You can test the sample locally by opening multiple browser sessions with the UR
7262
3. Get the `Connection String` and `Endpoint URL` from the Azure portal. For more information on connection strings, see [Create an Azure Communication Services resources](../quickstarts/create-communication-resource.md)
7363
4. Once you get the `Connection String` and `Endpoint URL`, Add both values to the **Server/appsettings.json** file found under the Chat Hero Sample folder. Input your connection string in the variable: `ResourceConnectionString` and endpoint URL in the variable: `EndpointUrl`.
7464

75-
### Local run
76-
77-
1. Go to the Chat folder and open the `Chat.csproj` solution in Visual Studio
78-
2. Run the project. The browser will open at localhost:5000.
65+
## Local run
7966

80-
#### Troubleshooting
67+
1. Set your connection string in `Server/appsettings.json`
68+
2. Set your endpoint URL string in `Server/appsettings.json`
69+
3. `npm run setup` from the root directory
70+
4. `npm run start` from the root directory
8171

82-
- Solution doesn't build, it throws errors during NPM installation/build
83-
84-
Clean/rebuild the C# solution
72+
You can test the sample locally by opening multiple browser sessions with the URL of your chat to simulate a multi-user chat.
8573

8674
## Publish the sample to Azure
8775

88-
1. Right click on the `Chat` project and select Publish.
89-
2. Create a new publish profile and select your Azure subscription.
90-
3. Before publishing, add your connection string with `Edit App Service Settings`, and fill in `ResourceConnectionString` as the key and provide your connection string (copied from appsettings.json) as the value.
76+
1. Under the root director, run these commands:
77+
```
78+
npm run setup
79+
npm run build
80+
npm run package
81+
```
82+
2. Use the Azure extension and deploy the Chat/dist directory to your app service
9183

9284
## Clean up resources
9385

@@ -110,4 +102,3 @@ For more information, see the following articles:
110102
- [Redux](https://redux.js.org/) - Client-side state management
111103
- [FluentUI](https://aka.ms/fluent-ui) - Microsoft powered UI library
112104
- [React](https://reactjs.org/) - Library for building user interfaces
113-
- [ASP.NET Core](/aspnet/core/introduction-to-aspnet-core?preserve-view=true&view=aspnetcore-3.1) - Framework for building web applications

0 commit comments

Comments
 (0)