elysiajs / eden

Fully type-safe Elysia client
MIT License
173 stars 41 forks source link

Eden treaty strip `index` in routes #81

Open kai2128 opened 7 months ago

kai2128 commented 7 months ago

@elysiajs/eden@1.0.11 elysia@1.0.13

index.ts:

import { treaty } from "@elysiajs/eden";
import Elysia from "elysia";

const app = new Elysia()
  .get("/test/index", () => "hello")
  .listen(3000);

const eden = treaty<typeof app>("localhost:3000", {
  onRequest: ( path, options ) => {
    console.log(path) // path = /test, should be /test/index
  }
});

console.log((await eden.test.index.get())); // -> NOT_FOUND

the request is being sent to /test but not /test/index