📦 EqualifyEverything / equalify

📄 router.ts · 9 lines
1
2
3
4
5
6
7
8
9import { event } from "./event";

export const router = async (routes) => {
    for (const [routeName, routeFunction] of Object.entries(routes)) {
        if (event.path.endsWith(`/${routeName}`)) {
            return routeFunction();
        }
    }
};