Const
Creates the runWithAmplifyServerContext function to run Amplify server side APIs in an isolated request context.
runWithAmplifyServerContext
This function should be called only once; you can use the returned runWithAmplifyServerContext across your codebase.
The input used to create the runWithAmplifyServerContext function.
The ResourcesConfig imported from the amplifyconfiguration.json file or manually created.
amplifyconfiguration.json
An object that contains the runWithAmplifyServerContext function.
import { createServerRunner } from '@aws-amplify/adapter-nextjs';import config from './amplifyconfiguration.json';export const { runWithAmplifyServerContext } = createServerRunner({ config }) Copy
import { createServerRunner } from '@aws-amplify/adapter-nextjs';import config from './amplifyconfiguration.json';export const { runWithAmplifyServerContext } = createServerRunner({ config })
Creates the
runWithAmplifyServerContextfunction to run Amplify server side APIs in an isolated request context.