Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eden treaty strip index in routes #81

Open
kai2128 opened this issue Apr 15, 2024 · 0 comments
Open

Eden treaty strip index in routes #81

kai2128 opened this issue Apr 15, 2024 · 0 comments

Comments

@kai2128
Copy link

kai2128 commented Apr 15, 2024

@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

@kai2128 kai2128 changed the title Eden treaty ignore index in routes Eden treaty strip index in routes Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant