Skip to content

Commit 846d7fc

Browse files
committed
revert pathname to request
1 parent dc29e1a commit 846d7fc

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ export async function netlifyAppEngineHandler(request: Request): Promise<Respons
127127

128128
// Example API endpoints can be defined here.
129129
// Uncomment and define endpoints as necessary.
130-
// if (context?.url?.pathname === '/api/hello') {
130+
// const pathname = new URL(request.url.pathname)
131+
// if (pathname === '/api/hello') {
131132
// return Response.json({ message: 'Hello from the API' });
132133
// }
133134

src/helpers/serverModuleHelpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ const NetlifyServerTsAppEngineCommonContent = /* typescript */ `export async fun
3333
3434
// Example API endpoints can be defined here.
3535
// Uncomment and define endpoints as necessary.
36-
// if (context?.url?.pathname === '/api/hello') {
36+
// const pathname = new URL(request.url.pathname)
37+
// if (pathname === '/api/hello') {
3738
// return Response.json({ message: 'Hello from the API' });
3839
// }
3940

0 commit comments

Comments
 (0)