Skip to content

Commit 82b2334

Browse files
committed
fix: add commented out example API to code snippets shown on incompatible server.ts error
1 parent 698a7a0 commit 82b2334

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/helpers/serverModuleHelpers.js

+14
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ import { render } from '@netlify/angular-runtime/common-engine'
1616
const commonEngine = new CommonEngine()
1717
1818
export async function netlifyCommonEngineHandler(request: Request, context: any): Promise<Response> {
19+
// Example API endpoints can be defined here.
20+
// Uncomment and define endpoints as necessary.
21+
// const pathname = new URL(request.url).pathname;
22+
// if (pathname === '/api/hello') {
23+
// return Response.json({ message: 'Hello from the API' });
24+
// }
25+
1926
return await render(commonEngine)
2027
}
2128
`
@@ -29,6 +36,13 @@ const angularAppEngine = new AngularAppEngine()
2936
export async function netlifyAppEngineHandler(request: Request): Promise<Response> {
3037
const context = getContext()
3138
39+
// Example API endpoints can be defined here.
40+
// Uncomment and define endpoints as necessary.
41+
// const pathname = new URL(request.url).pathname;
42+
// if (pathname === '/api/hello') {
43+
// return Response.json({ message: 'Hello from the API' });
44+
// }
45+
3246
const result = await angularAppEngine.handle(request, context)
3347
return result || new Response('Not found', { status: 404 })
3448
}

0 commit comments

Comments
 (0)