server/routes

Each file in server/routes/ becomes a raw HTTP route.

Paths come from the file system. Methods live on the route module's default export object.

import type { InvocationContext } from "vuloom/server";

export default {
  middleware: ["server-trace-route"],
  async GET() {
    return Response.json({ ok: true });
  },
  async POST(ctx: InvocationContext) {
    return Response.json({
      body: await ctx.request.text(),
    });
  },
};

Route files can also export:

  • route-local middleware with middleware: ['auth'] or middleware functions
  • route metadata with meta
  • a fallback handler() for methods you do not define explicitly

Route ownership is strict: if a server/routes pattern overlaps with an app/pages pattern, Vuloom throws.