Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 606 Bytes

File metadata and controls

23 lines (17 loc) · 606 Bytes

Global route config

Every WinterSpec project has a global wrapper defined in a file often called with-winter-spec.ts. This defines things like:

  • Authentication methods
  • Global middleware
  • Metadata for code generation

Here's an example:

// src/with-winter-spec.ts
import { createWithWinterSpec } from "winterspec"

export const withWinterSpec = createWithWinterSpec({
  beforeAuthMiddleware: [],
  authMiddleware: {},
  afterAuthMiddleware: [],

  // Defaults to true. When true, all JSON responses are validated against the route's response schema.
  shouldValidateResponses: true,
})