veryfront
Configuration, server bootstrap, routing, data fetching, and input validation.Import
Examples
Configuration
API routes
Data loading
Exports
Components
| Name | Description |
|---|---|
CommonSchemas | Built-in Zod schemas (email, URL, etc.) |
INPUT_VALIDATION_FAILED | HTTP request input validation failures (replaces ValidationError) |
Functions
| Name | Description |
|---|---|
apiNotFound | 404 Not Found response |
apiRedirect | Redirect response |
badRequest | 400 Bad Request response |
createHandler | Create HTTP request handler |
createValidatedHandler | Create a validated API handler wrapper that auto-validates body/query with Zod schemas |
createValidationError | Create an input validation error. |
defineConfig | Define project configuration |
forbidden | 403 Forbidden response |
getEnv | Read environment variable (typed) |
json | JSON response helper |
notFound | Throw 404 in data loaders |
parseFormData | Parse multipart form data |
parseJsonBody | Parse and validate JSON body |
parseQueryParams | Parse and validate query params |
redirect | Throw redirect in data loaders |
sanitizeData | Sanitize data to prevent XSS and prototype pollution attacks. |
serverError | 500 Internal Server Error response |
startServer | Start a Veryfront server in development or production mode. |
toNodeHandler | Convert a Web API request handler into a Node.js HTTP request listener. |
unauthorized | 401 Unauthorized response |
Types
| Name | Description |
|---|---|
APIContext | API route handler context |
APIHandler | API route handler signature |
APIResponse | API handler response type |
APIRoute | Route with method handlers |
DataContext | getServerData context |
InferGetServerDataProps | Utility type to infer props from a page with data |
MDXFrontmatter | Parsed MDX frontmatter |
PageContext | Page runtime context |
PageWithData | Page with data fetching capabilities |
StartServerOptions | Server options. Defaults to development mode with HMR. |
StaticPathsResult | getStaticPaths return type |
ValidatedHandlerConfig | createValidatedHandler config |
ValidatedHandlerFunction | Handler with validated inputs |
VeryfrontConfig | Project configuration shape |
VeryfrontHandler | Web API request handler with WebSocket upgrade and HMR helpers. |
VeryfrontServer | Running server instance with lifecycle controls. |
Related
veryfront/head— Declarative<head>metadataveryfront/router— Client-side routing and navigationveryfront/context— Access route params and page data