Skip to content

Commit

Permalink
feat: add lambda guide
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Jul 14, 2024
1 parent 407a2dc commit 6e50c8b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"quickstart/remix",
"quickstart/express",
"quickstart/nuxt",
"quickstart/h3"
"quickstart/h3",
"quickstart/lambda"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion quickstart/h3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ In this guide, we will add a Novu [Bridge Endpoint](/concepts/endpoint) to a H3
<Step title="Start your application">
Start your H3 server with the Novu Endpoint configured.

If your Remix application is running on other than `4000` port, restart the `npx novu dev` command with the port:
If your H3 application is running on other than `4000` port, restart the `npx novu dev` command with the port:

```tsx
npx novu@latest dev --port <YOUR_H3_PORT>
Expand Down
55 changes: 55 additions & 0 deletions quickstart/lambda.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: "How to send notifications with AWS Lambda and Novu Framework"
sidebarTitle: "AWS Lambda"
---

import LocalStudio from "/snippets/quickstart/start-studio.mdx";
import DeployApp from "/snippets/quickstart/deploy.mdx";
import TestStep from "/snippets/quickstart/test.mdx";
import PackagesStep from "/snippets/quickstart/packages.mdx";
import SecretStep from "/snippets/quickstart/secret.mdx";
import NextStepsStep from "/snippets/quickstart/next-steps.mdx";
import WorkflowStep from "/snippets/quickstart/workflow.mdx";

In this guide, we will add a Novu [Bridge Endpoint](/concepts/endpoint) to a AWS Lambda application and send our first test workflow.

<Steps>
<LocalStudio />
<PackagesStep />
<Step title="Add a Novu API Endpoint">
<CodeGroup>
```typescript src/functions/api/novu.ts
import { serve } from "@novu/framework/lambda";
import { workflow } from "@novu/framework";
import { testWorkflow } from "../novu/workflows";

module.exports.novu = serve({
workflows: [testWorkflow],
});
```
</CodeGroup>
</Step>
<SecretStep />

<Step title="Create your workflow definition">
Add a `novu` folder in your app folder as such `novu/workflows.ts` that will contain your workflow definitions.

<WorkflowStep />
</Step>


<Step title="Start your application">
Start your AWS Lambda server with the Novu Endpoint configured.

If your Local Lambda application is running on other than `4000` port, restart the `npx novu dev` command with the port:

```tsx
npx novu@latest dev --port <YOUR_AWS LAMBDA_PORT>
```
</Step>
<TestStep framework="AWS Lambda" />
<DeployApp />

</Steps>

<NextStepsStep />

0 comments on commit 6e50c8b

Please sign in to comment.