Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

ServerPlatform

interfaz

Servicios del host que recibe cada petición en RequestContext.platform.

ts
import type { ServerPlatform } from "@meekojs/meeko/server";

Source code src/server/runtime/platform.ts:35

Declaración #

ts
interface ServerPlatform<Env = unknown> {
	readonly name: PlatformName
	readonly env: Env
	waitUntil(promise: Promise<unknown>): void
}

Type parameters #

Env = unknown

Tipo de las variables o bindings del entorno.

Example #

ts
import { defineApiRoute } from "@meekojs/meeko/server";

export default defineApiRoute({
  handler: ({ context }) => {
    context.platform.waitUntil(fetch("https://metrics.example.com/hit", { method: "POST" }));
    return { platform: context.platform.name };
  },
});

Miembros #

name #

propiedad sólo lectura

readonly name: PlatformName

Runtime que ejecuta la aplicación.

env #

propiedad sólo lectura

readonly env: Env

Variables de entorno o bindings del runtime que entrega el adaptador.

waitUntil #

método

waitUntil(promise: Promise<unknown>): void

Mantiene vivo un trabajo en segundo plano tras la respuesta, cuando el host lo permite.

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/runtime/platform.ts