Closed dodas closed 2 months ago
It works fine with elysia@1.1.3
import Elysia, { t } from "elysia";
const child = new Elysia({ normalize: true }).get("/", () => ({ a: 1, b: 2 }), {
response: t.Object({ a: t.Number() }),
});
const main = new Elysia().use(child);
const resp = await main.handle(new Request("http://localhost/"));
console.log(resp, await resp.json());
result is
Response (0 KB) {
ok: true,
url: "",
status: 200,
statusText: "",
headers: Headers {
"content-type": "application/json;charset=utf-8",
},
redirected: false,
bodyUsed: true
} {
a: 1,
}
What version of Elysia.JS is running?
1.0.25
What platform is your computer?
What steps can reproduce the bug?
What is the expected behavior?
The
normalize
config option should be respected on individual Elysia sub-instances.What do you see instead?
Normalize only works when it's set on the root Elysia instance (
main
in the example above).