elysia-autoload
elysia-autoload copied to clipboard
Add support for "new Elysia" routes
Currently routes only work when defining them like this
import type { ElysiaApp } from "app";
export default (app: ElysiaApp) => app.get("/", { hello: "world" });
Normally i often define my routes like this
import Elysia from "elysia";
export default new Elysia().get("/", { hello: "world" });
Which doesn't seem to work with autoload but it should. Also this should work which does not
import Elysia from "elysia";
export default () => new Elysia().get("/", { hello: "world" });
The first one throws an error and the second one doesn't but the second one also doesn't handle anything i still get an 404 on "/"