Skip to content

Commit e37a3c1

Browse files
authored
chore: renovate (#47)
1 parent 3ef64b2 commit e37a3c1

File tree

5 files changed

+22
-752
lines changed

5 files changed

+22
-752
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RESEND_API_KEY=

app/api/send/route.ts

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
const RESEND_API_KEY = 're_123456789';
1+
import { Resend } from "resend";
2+
3+
const resend = new Resend(process.env.RESEND_API_KEY);
24

35
export async function POST() {
4-
const res = await fetch('https://api.resend.com/emails', {
5-
method: 'POST',
6-
headers: {
7-
'Content-Type': 'application/json',
8-
Authorization: `Bearer ${RESEND_API_KEY}`,
9-
},
10-
body: JSON.stringify({
11-
from: 'Acme <[email protected]>',
12-
13-
subject: 'hello world',
14-
html: '<strong>it works!</strong>',
15-
}),
6+
const response = await resend.emails.send({
7+
from: 'Acme <[email protected]>',
8+
9+
subject: 'hello world',
10+
html: '<strong>it works!</strong>',
1611
});
1712

18-
if (res.ok) {
19-
const data = await res.json();
20-
return Response.json(data);
21-
}
13+
return Response.json(response, {
14+
status: response.error ? 500 : 200,
15+
});
2216
}

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"private": true,
33
"scripts": {
4-
"dev": "next dev --turbo",
4+
"dev": "next dev",
55
"build": "next build",
66
"start": "next start"
77
},
88
"dependencies": {
9-
"next": "^14.2.3",
10-
"react": "^18.3.1",
11-
"react-dom": "^18.3.1",
12-
"resend": "^3.2.0"
9+
"next": "^16.0.1",
10+
"react": "^19.2.0",
11+
"react-dom": "^19.2.0",
12+
"resend": "^6.4.0"
1313
},
1414
"devDependencies": {
1515
"@types/node": "20.19.4",
16-
"@types/react": "18.3.3",
16+
"@types/react": "^19.2.2",
17+
"@types/react-dom": "^19.2.2",
1718
"typescript": "5.8.3"
1819
}
1920
}

0 commit comments

Comments
 (0)