Skip to content

Commit a7a5767

Browse files
committed
add apiKey option
1 parent 22ff6d3 commit a7a5767

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Put options under `custom.appsync-simulator` in your `serverless.yml` file
3333

3434
| option | default | description |
3535
|--------|---------|-------------|
36+
| apiKey | `0123456789` | When using `API_KEY` as authentication type, the key to authenticate to the endpoint. |
3637
| port | 20002 | AppSync operations port |
3738
| wsPort | 20003 | AppSync subscriptions port |
3839
| location | . (base directory) | Location of the lambda functions handlers. |

src/getAppSyncConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default function getAppSyncConfig(context, appSyncConfig) {
8787

8888
const makeAppSync = () => ({
8989
name: appSyncConfig.name,
90-
apiKey: context.options.apiKey || '123456',
90+
apiKey: context.options.apiKey,
9191
defaultAuthenticationType: makeAuthType(appSyncConfig),
9292
additionalAuthenticationProviders: (appSyncConfig.additionalAuthenticationProviders || [])
9393
.map(makeAuthType),

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class ServerlessAppSyncSimulator {
1414
this.serverlessLog = serverless.cli.log.bind(serverless.cli);
1515
this.options = merge(
1616
{
17+
apiKey: '0123456789',
1718
port: 20002,
1819
wsPort: 20003,
1920
location: '.',

0 commit comments

Comments
 (0)