As of last week, Bun has taken over the JavaScript world. In this post, we will see how to create an HTTP server in Bun using the Elysia Framework....
For further actions, you may consider blocking this person and/or reporting abuse
Just FYI you can use
Response.json
this will automatically do the parsing and set the headersoh, thank you I didn't know that 😄🙌!
Have you encountered any challenges while migrating an Express application to Elysia? If so, could you share your experiences and any obstacles you encountered? I'm curious about whether Elysia can seamlessly replace Express, especially regarding middleware compatibility, configuration options, and any limitations you might have come across.
Middlewares in Elysia is a bit different compared to Express. See if this helps
I was considering building this server using purely Bun.js. Saw some tutorials where they were handling routes simply by using 'ifs' inside the Bun.serve block and was not very convinced about that because it looks untidy, but wouldn't like to use extra dependencies like Elysia, Hono, Express...
Is it possible to do it using only Bun.js? What are the drawbacks? Why using Elysia, Hono, Express is better?
Most of the time, it is better to build stuffs without the use of a framework unless you have specific reasons to. But, like you said, in this case, it can make your code a bit untidy. That's where frameworks come in. Using a framework like Elysia for example, can help to speed up the development process. Also, as shown in the graph above, Elysia claims to be much faster than any other frameworks. But, if you can build things without the need of a framework, go for it 👍
I was looking for this tutorial just now, thnks
You are welcome!
So the future of JS runtime is Bun :love:
💘💘
Really helpful ❤️
I'm glad that I saw this 😁
Glad you liked it!
Too many Runtimes and JS frameworks. My mind is exploding XD
But is good to know that the technology advances so fast
🥲🥲