Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _chapters/add-an-api-to-create-a-note.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ It includes the API endpoint that we created.

Now we are ready to test our new API.

Head over to the **API** tab in the [SST Console]({{ site.console_url }}) and check out the new API.
Head over to the **API** tab in the [SST Console]({{ site.old_console_url }}) and check out the new API.

![SST Console API tab](/assets/part2/sst-console-api-tab.png)

Expand Down
2 changes: 1 addition & 1 deletion _chapters/add-an-api-to-delete-a-note.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Let's test the delete note API.

In a [previous chapter]({% link _chapters/add-an-api-to-get-a-note.md %}) we tested our create note API. It should've returned the new note's id as the `noteId`.

In the **API** tab of the [SST Console]({{ site.console_url }}), select the `DELETE /notes/{id}` API.
In the **API** tab of the [SST Console]({{ site.old_console_url }}), select the `DELETE /notes/{id}` API.

{%change%} Set the `noteId` as the **id** and click **Send**.

Expand Down
2 changes: 1 addition & 1 deletion _chapters/add-an-api-to-get-a-note.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ You should see that the API stack is being updated.

Let's test the get notes API. In the [previous chapter]({% link _chapters/add-an-api-to-get-a-note.md %}) we tested our create note API. It should've returned the new note's id as the `noteId`.

Head back to the **API** tab in the [SST Console]({{ site.console_url }}) and select the `/notes/{id}` API. You might have to refresh your console.
Head back to the **API** tab in the [SST Console]({{ site.old_console_url }}) and select the `/notes/{id}` API. You might have to refresh your console.

{%change%} Set the `noteId` as the **id** and click **Send**.

Expand Down
2 changes: 1 addition & 1 deletion _chapters/add-an-api-to-list-all-the-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ You should see that the API stack is being updated.

### Test the API

Let's test the list all notes API. Head to the **API** tab of the [SST Console]({{ site.console_url }}).
Let's test the list all notes API. Head to the **API** tab of the [SST Console]({{ site.old_console_url }}).

{%change%} Select the `/notes` API and click **Send**.

Expand Down
2 changes: 1 addition & 1 deletion _chapters/add-an-api-to-update-a-note.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ You should see that the API stack is being updated.

Now we are ready to test the new API. In [an earlier chapter]({% link _chapters/add-an-api-to-get-a-note.md %}) we tested our create note API. It should've returned the new note's id as the `noteId`.

Head to the **API** tab in the [SST Console]({{ site.console_url }}) and select the `PUT /notes/{id}` API.
Head to the **API** tab in the [SST Console]({{ site.old_console_url }}) and select the `PUT /notes/{id}` API.

{%change%} Set the `noteId` as the **id** and in the **Body** tab set the following as the request body. Then hit **Send**.

Expand Down
2 changes: 1 addition & 1 deletion _chapters/adding-auth-to-our-serverless-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ You should see something like this at the end of the deploy process.
UserPoolId: us-east-1_TYEz7XP7P
```

You'll also see our new User Pool if you head over to the **Cognito** tab in the [SST Console]({{ site.console_url }}).
You'll also see our new User Pool if you head over to the **Cognito** tab in the [SST Console]({{ site.old_console_url }}).

![SST Console Cognito tab](/assets/part2/sst-console-cognito-tab.png)

Expand Down
2 changes: 1 addition & 1 deletion _chapters/create-a-dynamodb-table-in-sst.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ You should see something like this at the end of the deploy process.
StorageStack
```

You can also head over to the **DynamoDB** tab in the [SST Console]({{ site.console_url }}) and check out the new table.
You can also head over to the **DynamoDB** tab in the [SST Console]({{ site.old_console_url }}) and check out the new table.

![SST Console DynamoDB tab](/assets/part2/sst-console-dynamodb-tab.png)

Expand Down
7 changes: 3 additions & 4 deletions _chapters/create-a-hello-world-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ SST v2.1.14 ready!

→ App: notes
Stage: Jay
Console: https://console.sst.dev/notes/Jay

✓ Deployed:
API
Expand All @@ -69,13 +68,13 @@ The `ApiEndpoint` is the API we just created. Let's test our endpoint. If you op

![Serverless Hello World API invoked](/assets/part2/sst-hello-world-api-invoked.png)

You can also head over to the **SST Console** link in your browser. The [SST Console]({{ site.docs_url }}/console) is a web based dashboard to manage your SST apps.
You can also head over to the **SST Console** link in your browser — [**old.console.sst.dev**]({{ site.old_console_url }}). The [SST Console]({{ site.docs_url }}/console) is a web based dashboard to manage your SST apps.

![SST Console Local tab](/assets/part2/sst-console-local-tab.png)

The **Local** tab shows you real-time logs from your apps.
Note that, there's a newer version of the [SST Console]({{ site.console_url }}). We'll be updating the guide to use this soon. But for now let's use the older version.

Note that when you hit this endpoint the Lambda function is being run locally.
The **Local** tab shows you real-time logs from your apps. Here when you hit this endpoint the Lambda function is being run _locally_.

## Deploying to prod

Expand Down
2 changes: 1 addition & 1 deletion _chapters/create-an-s3-bucket-in-sst.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ You should see that the storage stack has been updated.
StorageStack
```

You can also head over to the **Buckets** tab in the [SST Console]({{ site.console_url }}) and check out the new bucket.
You can also head over to the **Buckets** tab in the [SST Console]({{ site.old_console_url }}) and check out the new bucket.

![SST Console Buckets tab](/assets/part2/sst-console-buckets-tab.png)

Expand Down
2 changes: 1 addition & 1 deletion _chapters/secure-our-serverless-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Making API request
}
```

It'll have created a new note for our test user in the **DynamoDB** tab of the [SST Console]({{ site.console_url }}).
It'll have created a new note for our test user in the **DynamoDB** tab of the [SST Console]({{ site.old_console_url }}).

![SST Console test user new note](/assets/part2/sst-console-test-user-new-note.png)

Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ google_analytics: "UA-3536629-11"
docs_url: "https://docs.sst.dev"
v1_conf_url: "https://v1conf.sst.dev"
console_url: "https://console.sst.dev"
old_console_url: "https://old.console.sst.dev"
forum_url: "https://discourse.sst.dev"
forum_thread_prefix: "/t/"
patreon_url: "https://www.patreon.com/serverless_stack"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,14 @@ import { APIGatewayProxyHandlerV2WithJWTAuthorizer } from "aws-lambda";
export const main: APIGatewayProxyHandlerV2WithJWTAuthorizer = async (
event
) => {

const jwtEmail = event?.requestContext?.authorizer?.jwt?.claims?.email;
const jwtName = event?.requestContext?.authorizer?.jwt?.claims?.name;
const jwtSubject = event?.requestContext?.authorizer?.jwt?.claims?.sub;

return {
statusCode: 200,
body: `Hello ${event.requestContext.authorizer.jwt.claims.sub}!`,
body: `Hello ${jwtName}! Your email is ${jwtEmail}. You are JWT subject ${jwtSubject}`,
};
};
```
Expand Down