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.

ModuleServerHandler

interfaz Since 1.2.0

Handler HTTP de servidor que añade un módulo con meeko.addServerHandler.

ts
import type { ModuleServerHandler } from "@meekojs/meeko/framework";

Source code src/modules/define-meeko-module.ts:130

Declaración #

ts
interface ModuleServerHandler {
	readonly route: string
	readonly handler: string | URL
}

Example #

ts
import type { ModuleServerHandler } from "@meekojs/meeko/framework";

const handler: ModuleServerHandler = { route: "/robots.txt", handler: new URL("../macros/shared/runtime/robots.ts", import.meta.url) };

Propiedades #

route #

propiedad sólo lectura

readonly route: string

Ruta exacta (pathname) que atiende, como "/sitemap.xml"; empieza por /.

handler #

propiedad sólo lectura

readonly handler: string | URL

Archivo cuyo export por defecto es (request: Request) => Response | Promise<Response>: ruta absoluta, URL file: o ruta relativa a la raíz del proyecto. Se ejecuta sólo en el servidor, después del middleware de servidor.

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/modules/define-meeko-module.ts