@@ -41,7 +41,9 @@ yarn add laravel-echo-api-gateway
4141npn install --save laravel-echo-api-gateway
4242```
4343
44- ### When using Bref
44+ ### Platform-specific instructions
45+
46+ #### A. When using Bref
4547
4648Next, when using Bref, we have to add some elements to our ` serverless.yml ` file. If using Vapor, these resources have
4749to be created by hand using the AWS CLI or console.
@@ -146,11 +148,11 @@ return $app->make(Handler::class);
146148
147149Now, 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
151153When 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
155157Create a DynamoDB table for the connections. Use `connectionId` (string) as a HASH key, and `channel` (string) as a SORT
156158key. Set the capacity setting to whatever you like (probably on-demand).
@@ -160,13 +162,13 @@ Create 2 indexes:
1601621. Name : ` lookup-by-connection` , key: `connectionId`, no sort key, projected: ALL
1611632. Name : ` lookup-by-channel` , key: `channel`, no sort key, projected: ALL
162164
163- # ### API Gateway
165+ # #### B2. API Gateway
164166
165167Create a new Websocket API. Enter a name and leave the route selection expression to what it is. Add a `$disconnect`
166168and `$default`. Set both integrations to `Lambda` and select your CLI lambda from the list. Set the name of the stage to
167169what 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
171173In IAM, go to roles and open `laravel-vapor-role`. Open the inline policy and edit it. On the JSON tab,
172174add `"execute-api:*"` to the list of actions.
@@ -183,7 +185,7 @@ LARAVEL_ECHO_API_GATEWAY_API_ID=your-websocket-api-id
183185LARAVEL_ECHO_API_GATEWAY_API_STAGE=your-api-stage-name
184186` ` `
185187
186- # ## For both Bref and Vapor
188+ # ## Generate front-end code
187189
188190Add to your javascript file :
189191
0 commit comments