Thursday, June 04, 2026 4:11:06 AM
> index.js
import { application } from "./application";

const controllerModules = import.meta.glob("./*_controller.js", {
  eager: true,
});

for (const [path, module] of Object.entries(controllerModules)) {
  const controllerName = path
    .match(/\.\/(.+)_controller\.js$/)[1]
    .replace(/_/g, "-");

  application.register(controllerName, module.default);
}
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 4294fb2