-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 /> |