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(); } } };
1 2 3 4 5 6 7 8 9
import { event } from "./event"; export const router = async (routes) => { for (const [routeName, routeFunction] of Object.entries(routes)) { if (event.path.endsWith(`/${routeName}`)) { return routeFunction(); } } };