Live data from Hacker News

Ask HN: Is Express still "de-facto" for building Node back ends?

news.ycombinator.com

61–70 of 100 posts

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#61

If you don’t have time to do research then surely you don’t have time to learn a new tool, right? Just use Express.

Asking others isn’t research?

I think the reference relates to the actual words used in the submission.

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#62
post #31

Nitro is the server baked into nuxt 3. I feel like web server frameworks have all been circling around the same set of features for like 10 years though.

I tried Nitro soon after Nuxt 3 came out and was very unimpressed. The whole thing felt half-baked, with missing features and essentially zero documentation.

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#63

Last I checked, Express is extremely slow and will significantly impact your SEO if you're a content business and doesn't really scale very well if you get huge amounts of traffic like I have. These days I use Go, Deno or Crystal which is much faster. For hosting I recommend Cloudflare Pages, Vercel, (maybe Netlify) and Render.

Express by itself isn't slow at all, neither does if affect your SEO. You completely ignored OP's question, lol.

And the answer is that express and node is 'de-facto' slow.

Nobody building a serious application in 2020 should consider express anymore for building a production grade application.

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#64

Follow-up question: Is there any backend framework which uses the fetch API. That is, where requests are standard Request objects ( https://developer.mozilla.org/en-US/docs/Web/API/Request ) and where you send (or return, or yield) standard Response objects ( https://developer.mozilla.org/en-US/docs/Web/API/Response )? I’m teaching a highschool kid web development and it would be very nice to be able to teach the sam…

I think Deno could be a good choice for that—it's an entire server side JavaScript runtime built around the idea of using web standards instead of server-specific code.

In addition to using standard Request and Response objects in its built-in server framework, Deno's approach to dependencies and TypeScript lends itself really well to educational settings—with no compilation step and no package management step, it's as simple to get started with Deno server-side as it is to start with HTML/JS in the browser—just open up a text editor and start writing!

https://deno.com/learn/api-servers

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#65

Not only is expressjs de-facto , it actually is a community design from before Node.js existed, with earlier implementations (connect, jackjs), including on non-Node.js SSJS-platforms; cf. [1]. Moreover, an expressjs/JSGI middleware can plug-in and directly run off the Node.js core http API, without the additional expressjs routing, etc. [1]: https://wiki.commonjs.org/wiki/JSGI/Level0/A/Draft2

It’s an approach I really enjoy. Back in the day express referred to itself as a sinatra-style library (ruby).

It also seems like the modern .NET Core Http request pipeline and minimal API are inspired by express.

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#67

I love threads like this, it's so stereotypical JS. OP asks if it's the de-facto choice which it objectively is, but everyone recommends their pet project or favourite library instead.

Demonstrably untrue.

Out of the 21 top level comments, all but two mentioned one or more of: fastify, express, kora, hona, adnos, bun/elysia

Half of them recommended Fastify.

Other results: 3 express, 2 hono, 2 bun/elysia, 1 adnos

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#68
post #23

Earlier quoted context omitted.

Could you share a bit more of your reasoning for choosing Fastify over Express and how was your experience since you switched? Express is my go-to but I'm always open to improving my ways.

Is Express.js still even maintained? Does it still adds new features? Also switched to Fastify. It has a great ecosystem and community. It's also easy to write custom plugins.

Why should it get new features?

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#69

Follow-up question: Is there any backend framework which uses the fetch API. That is, where requests are standard Request objects ( https://developer.mozilla.org/en-US/docs/Web/API/Request ) and where you send (or return, or yield) standard Response objects ( https://developer.mozilla.org/en-US/docs/Web/API/Response )? I’m teaching a highschool kid web development and it would be very nice to be able to teach the sam…

Isn't that what node-fetch is for? https://www.npmjs.com/package/node-fetch

The fetch API is implemented in node and is provided as globals since node 18. So node-fetch is effectivly obsolete at this point.

What I’m looking for is a server framework (like express.js) which uses these standards instead of their home made APIs. So instead of:

    app.use(json());
    app.get("/echo", (req, res) {
      const { message } = req.body;

      res.append("Content-Type", "application/json");
      res.send(JSON.stringify({ message }));
    });
I could write something like:

    app.get("/echo", async (request) => {
      const { message } = await request.json();
      const headers = new Headers([[ "Content-Type", "application/json" ]]);

      return new Response(
        JSON.stringify({ message }),
        { headers },
      );
    });

Re: Ask HN: Is Express still "de-facto" for building Node back ends?

#70

Follow-up question: Is there any backend framework which uses the fetch API. That is, where requests are standard Request objects ( https://developer.mozilla.org/en-US/docs/Web/API/Request ) and where you send (or return, or yield) standard Response objects ( https://developer.mozilla.org/en-US/docs/Web/API/Response )? I’m teaching a highschool kid web development and it would be very nice to be able to teach the sam…

I think Deno could be a good choice for that—it's an entire server side JavaScript runtime built around the idea of using web standards instead of server-specific code. In addition to using standard Request and Response objects in its built-in server framework, Deno's approach to dependencies and TypeScript lends itself really well to educational settings—with no compilation step and no package management step, it's…

Yes, this is exactly how I want to write my servers while teaching web-development.

Only problem is it is kind of hard to justify teaching Deno when Node is so overwhelmingly used in the industry.

Post reply on HN