src/middleware
The src/middleware
directory is where you define middleware functions for your Corract application. The heart of Corract's SSR process. Middleware functions are used to intercept requests and responses, allowing you to perform actions such as authentication, logging, or modifying request data before it reaches the route handlers.
This directory is essential for implementing custom logic that needs to run before or after the main request handling process. And is used to inject server side data into your components, enabling dynamic rendering based on the request context. Middleware is applied to specific routes as defined in your app-def.ts, giving you flexibility in how you handle requests across your application.
This number: 313
represents how many times any docs page has been rendered since the last restart. Try disabling JavaScript in your browser—this count will still increase. That's because the count is tracked in the docs routes' middleware, meaning the server renders and delivers the full page regardless of client-side JS. This highlights a core strength of Corract's SSR: complete page rendering without relying on JavaScript. Last render timestamp: 2025-08-02T14:24:26.461Z
.