leafRouting

Routing is directory-based. You can make as many folders with routes as you want in the source code directory.

After creating routes directory

Every route.ts is taking path from directories names. If you created folder called routes and inside you'll create file route.ts it has path '/'. You can make for example folder 'user' inside routes folder and then inside create route.ts, path will be '/user'.

Every route must be in route.ts or route.js to be detected in loader function.

import type { ArcRequest, ArcResponse } from "@arcend/core";

const GET = async(req: ArcRequest, res: ArcResponse) =>
{
    return {
        path: req.path
    };
};
export { GET };

// {path: '/'}

Last updated