You can customize Elysia behavior by:
listen
Constructor will change some behavior of Elysia.
.listen
will config any value for starting server.
By default listen
will either accept number
or Object
.
For Object, listen
accept the same value as Bun.serve
, you can provide any custom one except serve
.
For providing WebSocket, please use WebSocket
You can provide a custom port from ENV by using process.env
You can get underlying Server
instance from either using:
.server
property.
Using callback in .listen