Skip to content

Commit b6959e5

Browse files
committed
Update README.md
1 parent 497592d commit b6959e5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ yarn add laravel-echo-api-gateway
4141
npn install --save laravel-echo-api-gateway
4242
```
4343

44-
### When using Bref
44+
### Platform-specific instructions
45+
46+
#### A. When using Bref
4547

4648
Next, when using Bref, we have to add some elements to our `serverless.yml` file. If using Vapor, these resources have
4749
to be created by hand using the AWS CLI or console.
@@ -146,11 +148,11 @@ return $app->make(Handler::class);
146148

147149
Now, deploy your app by running `serverless deploy` or similar. Write down the websocket url the output gives you.
148150

149-
### When using Vapor
151+
#### B. When using Vapor
150152

151153
When using Vapor, you will have to create these required resources by hand using the AWS CLI or Console:
152154

153-
#### DynamoDB table for connections
155+
##### B1. DynamoDB table for connections
154156

155157
Create a DynamoDB table for the connections. Use `connectionId` (string) as a HASH key, and `channel` (string) as a SORT
156158
key. Set the capacity setting to whatever you like (probably on-demand).
@@ -160,13 +162,13 @@ Create 2 indexes:
160162
1. Name: `lookup-by-connection`, key: `connectionId`, no sort key, projected: ALL
161163
2. Name: `lookup-by-channel`, key: `channel`, no sort key, projected: ALL
162164

163-
#### API Gateway
165+
##### B2. API Gateway
164166

165167
Create a new Websocket API. Enter a name and leave the route selection expression to what it is. Add a `$disconnect`
166168
and `$default`. Set both integrations to `Lambda` and select your CLI lambda from the list. Set the name of the stage to
167169
what you desire and create the API. Once created, write down the ID, as we'll need it later.
168170

169-
#### IAM Permissions
171+
##### B3. IAM Permissions
170172

171173
In IAM, go to roles and open `laravel-vapor-role`. Open the inline policy and edit it. On the JSON tab,
172174
add `"execute-api:*"` to the list of actions.
@@ -183,7 +185,7 @@ LARAVEL_ECHO_API_GATEWAY_API_ID=your-websocket-api-id
183185
LARAVEL_ECHO_API_GATEWAY_API_STAGE=your-api-stage-name
184186
```
185187

186-
### For both Bref and Vapor
188+
### Generate front-end code
187189

188190
Add to your javascript file:
189191

0 commit comments

Comments
 (0)