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.

ServerHeaders

tipo Since 1.7.0

Cabeceras de las respuestas de un adaptador con servidor (server.headers). Una clave con nombre de cabecera se aplica a todas las respuestas; una clave que empieza por / es un patrón de ruta (pathname, sin query) cuyas cabeceras se aplican sólo a las URL que coinciden, después de las globales y en el orden escrito. En el patrón, * sustituye a cualquier secuencia de caracteres, / incluida: "/docs/*" coincide con /docs/api, pero no con /docs. Una cabecera que la respuesta ya trae (de un handler, un middleware o Meeko) no se sustituye.

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

Source code src/modules/define-meeko-config.ts:44

Declaración #

ts
type ServerHeaders = Readonly<Record<string, string | Readonly<Record<string, string>>>>

Example #

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

const headers: ServerHeaders = {
  "X-Content-Type-Options": "nosniff",
  "Referrer-Policy": "strict-origin-when-cross-origin",
  "/admin/*": { "X-Robots-Tag": "noindex" },
};

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