@izzyjs/route
Version:
Use your AdonisJs routes in your Inertia.js application
12 lines (11 loc) • 330 B
JavaScript
import { namedRoutes } from '../generate_routes.js';
/**
* A Japa plugin to expose the named routes to the global scope
* @returns The Japa plugin function
*/
export function izzyRoutePlugin(app) {
return async () => {
const routes = await namedRoutes(app);
globalThis.__izzy_route__ = { routes };
};
}