HYPERJS.AI

CORS

v0.1.0Minimal, strict CORS middleware for Hyper.

$ hyper add cors

Copies 1 file into src/hyper/cors/ and updates hyper.lock.json.

DEPS

FILES

README

@hyper/cors

Minimal, strict CORS middleware for Hyper.

Install

Components are installed as source into your repo, not pulled from npm:

bunx hyper add cors

Wires the alias @hyper/cors to src/hyper/cors/ (configurable in hyper.config.json). See hyperjs.ai for the full registry.

Usage

import { Hyper } from "@hyper/core"
import { corsPlugin } from "@hyper/cors"

export default new Hyper()
  .use(corsPlugin({ origin: ["https://example.com"] }))
  .get("/", () => ({ hello: "world" }))
  .listen(3000)

Docs

See the main README and docs/ for guides and integration recipes.

License

MIT

MANIFEST