@aziontech/opennextjs-azion
Version:
Azion builder for Next.js apps
31 lines (30 loc) • 1.05 kB
TypeScript
/**
* This code was originally copied and modified from the @opennextjs/cloudflare repository.
* Significant changes have been made to adapt it for use with Azion.
*/
/**
* Initialization for the workerd runtime.
*
* The file must be imported at the top level the worker.
*/
/**
* Executes the handler with the Azion context.
*/
export declare function runWithAzionRequestContext(request: Request, env: AzionEnv, ctx: ExecutionContext, handler: () => Promise<Response>): Promise<Response>;
/**
* Initializes the runtime on the first call,
* no-op on subsequent invocations.
*/
export declare function init(_request: Request, _env: AzionEnv): void;
/**
* Populate process.env with:
* - the environment variables and secrets from the azion platform
* - the variables from Next .env* files
* - the origin resolver information
*/
export declare function populateProcessEnv(url: URL, env: AzionEnv): void;
declare global {
var __BUILD_TIMESTAMP_MS__: number;
var __NEXT_BASE_PATH__: string;
var __DEPLOYMENT_ID__: string;
}