elysia
elysia copied to clipboard
Support class serialization in response
What version of Elysia is running?
1.1.12
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
Instantiate a class and returns it with Elysia:
import { Elysia } from "elysia";
class MyClass {
constructor(public name: string) {}
}
const object = new MyClass("Elysia");
const app = new Elysia().get("/", () => object).listen(3000);
console.log(
`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`
);
The response from GET / is: [object Object]
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
Have you try removing the node_modules
and bun.lockb
and try again yet?
yes