diff --git a/src/pages/[platform]/build-a-backend/server-side-rendering/index.mdx b/src/pages/[platform]/build-a-backend/server-side-rendering/index.mdx index 423ca77a1c8..bf728ab6113 100644 --- a/src/pages/[platform]/build-a-backend/server-side-rendering/index.mdx +++ b/src/pages/[platform]/build-a-backend/server-side-rendering/index.mdx @@ -244,12 +244,12 @@ Ensure this environment variables is accessible in your Next.js app's server run The `createAuthRouteHandlers` function is created by the `createServerRunner` function call when you configure Amplify for server-side usage. You can export this function from your `amplifyServerUtils.ts` file. You can also configure cookie attributes with the `runtimeOptions` parameter. -```typescript title="utils/amplifyServerUtils.ts" +```typescript title="src/utils/amplifyServerUtils.ts" import { createServerRunner } from '@aws-amplify/adapter-nextjs'; import outputs from '@/amplify_outputs.json'; export const { - runWithAmplifyServerContext + runWithAmplifyServerContext, // highlight-start createAuthRouteHandlers, // highlight-end @@ -274,7 +274,7 @@ Create an API route using the `createAuthRouteHandlers` function. For example: ```typescript title="src/app/api/auth/[slug].ts" -import { createAuthRouteHandlers } from "@/amplifyServerUtils"; +import { createAuthRouteHandlers } from "@/utils/amplifyServerUtils"; export const GET = createAuthRouteHandlers({ redirectOnSignInComplete: "/home", @@ -284,7 +284,7 @@ export const GET = createAuthRouteHandlers({ ```typescript title="src/pages/api/auth/[slug].ts" -import { createAuthRouteHandlers } from "@/amplifyServerUtils"; +import { createAuthRouteHandlers } from "@/utils/amplifyServerUtils"; export default createAuthRouteHandlers({ redirectOnSignInComplete: "/home", diff --git a/src/pages/gen1/[platform]/build-a-backend/server-side-rendering/nextjs/index.mdx b/src/pages/gen1/[platform]/build-a-backend/server-side-rendering/nextjs/index.mdx index 2854733b0e5..3f567c17a31 100644 --- a/src/pages/gen1/[platform]/build-a-backend/server-side-rendering/nextjs/index.mdx +++ b/src/pages/gen1/[platform]/build-a-backend/server-side-rendering/nextjs/index.mdx @@ -246,12 +246,12 @@ Ensure this environment variables is accessible in your Next.js app's server run The `createAuthRouteHandlers` function is created by the `createServerRunner` function call when you configure Amplify for server-side usage. You can export this function from your `amplifyServerUtils.ts` file. You can also configure cookie attributes with the `runtimeOptions` parameter. -```typescript title="utils/amplifyServerUtils.ts" +```typescript title="src/utils/amplifyServerUtils.ts" import { createServerRunner } from '@aws-amplify/adapter-nextjs'; import config from '@/amplifyconfiguration.json'; export const { - runWithAmplifyServerContext + runWithAmplifyServerContext, // highlight-start createAuthRouteHandlers, // highlight-end @@ -276,7 +276,7 @@ Create an API route using the `createAuthRouteHandlers` function. For example: ```typescript title="src/app/api/auth/[slug].ts" -import { createAuthRouteHandlers } from "@/amplifyServerUtils"; +import { createAuthRouteHandlers } from "@/utils/amplifyServerUtils"; export const GET = createAuthRouteHandlers({ redirectOnSignInComplete: "/home", @@ -286,7 +286,7 @@ export const GET = createAuthRouteHandlers({ ```typescript title="src/pages/api/auth/[slug].ts" -import { createAuthRouteHandlers } from "@/amplifyServerUtils"; +import { createAuthRouteHandlers } from "@/utils/amplifyServerUtils"; export default createAuthRouteHandlers({ redirectOnSignInComplete: "/home",