Skip to content

Entry

The dreamkit entry allows you to programmatically define services, middlewares, api functions and routes in a single file.

It can be used as an optional alternative to the file routing system and both can work together at the same time. In addition, it has an advanced tree shaking system that separates each route with its dependencies and is compatible with HMR.

All examples shown in the documentation make use of this mechanic to more easily illustrate the code. And remember, the entry is optional and you can use the file routing system also.

/src/dreamkit.tsx
import { $route } from "dreamkit";
export default $route.path("/").create(() => {
return <>Hello World</>;
});