Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit b0b4a5e

Browse files
committed
Simplify project so it doesn't need an update to the nitric.yaml config.
1 parent be015ee commit b0b4a5e

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

docs/guides/go/realtime-messaging.mdx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ If everything is working as expected, you can now delete all files/folders in th
6868

6969
## Building the WebSocket Application
7070

71-
Let's begin by setting up the WebSocket application. First, create a new folder called `websockets` within the services directory. Inside this folder, add a file named `main.go`, and include the following code:
71+
Let's begin by setting up the WebSocket application. Add a file named `main.go` to your 'services/' folder, and include the following code:
7272

73-
```go title:services/websockets/main.go
73+
```go title:services/main.go
7474
package main
7575

7676
import (
@@ -238,23 +238,14 @@ Do a quick `go mod tidy` to make sure all new dependencies are resolved.
238238

239239
## Ok, let's run this thing!
240240

241-
Now that you have your WebSocket application defined with handlers for each event, it's time to test it locally. Update your `nitric.yaml` to point to the service at `websockets/main.go`:
242-
243-
```yaml
244-
services:
245-
- match: websockets/*
246-
runtime: go
247-
start: go run ./$SERVICE_PATH
248-
```
241+
Now that you have your WebSocket application defined with handlers for each event, it's time to test it locally.
249242

250243
```bash
251244
nitric start
252245
```
253246

254247
Once it starts, the application will be ready to accept WebSocket connections. You can use a WebSocket client like Postman or any other WebSocket tool to test the application. Alternatively, you can use the [Nitric Dashboard](/get-started/foundations/projects/local-development#local-dashboard).
255248

256-
We will keep it running for our tests.
257-
258249
## Deploy to the cloud
259250

260251
At this point, you can deploy what you've built to any of the supported cloud providers. In this example we'll deploy to AWS. Start by setting up your credentials and configuration for the [nitric/aws provider](/providers/pulumi/aws).

0 commit comments

Comments
 (0)