Skip to content

Commit 89b14e2

Browse files
feat(ef templates): replace context.json with Response.json (#5342)
* feat(ef templates): replace context.json with Response.json * feat: use context object Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 7eb4479 commit 89b14e2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/functions-templates/typescript/geolocation/{{name}}.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default async (request: Request, context: Context) => {
1717
// }
1818
// }
1919

20-
return context.json({
20+
return Response.json({
2121
geo: context.geo,
2222
header: request.headers.get("x-nf-geo"),
2323
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Context } from "https://edge.netlify.com";
22

33
export default async (request: Request, context: Context) => {
4-
return context.json({ hello: "world" });
4+
return Response.json({ hello: "world", location: context.geo.city });
55
};

0 commit comments

Comments
 (0)