TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

84 pointsby scstepsover 1 year ago
It's been a while since I've last used node to build a backend, and the last time I did Express was the go-to solution. Is that still the case? I don't have much time to do too much research and I usually default to the most popular solution in such cases.

30 comments

NylonMeltdownover 1 year ago
Maybe it&#x27;s still standard, but if you don&#x27;t want to shoot yourself in the foot, just stay away from it.<p>Express&#x27;s API is horrible. It&#x27;s not integrated with Promises (async&#x2F;await) at all, so be prepared to wrap every async endpoint (so probably all of them) with a custom error handling wrapper. If you don&#x27;t (and don&#x27;t have a big catch-block around the whole implementation), an unhandled error will hang the connection forever without a response.<p>Also, the API makes it pretty much impossible to write &quot;wrapping&quot; middleware, for example if you want output validation. As soon as an express middleware calls `next`, it&#x27;s done and there&#x27;s no way intercepting it before a response is sent.<p>It also <i>still</i> doesn&#x27;t support Node&#x27;s HTTP2, just some (nowadays) weird third-party HTTP2 implementation.<p>The standard `compression` middleware also seems abandoned, not supporting brotli (so you&#x27;ll have worse loading times), despite Node.js natively providing the required functions for years.<p>I&#x27;ll second `fastifiy` or `koa`.
评论 #38059881 未加载
评论 #38076917 未加载
评论 #38060745 未加载
tannhaeuserover 1 year ago
Not only is expressjs <i>de-facto</i>, 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&#x2F;JSGI middleware can plug-in and directly run off the Node.js core http API, without the additional expressjs routing, etc.<p>[1]: <a href="https:&#x2F;&#x2F;wiki.commonjs.org&#x2F;wiki&#x2F;JSGI&#x2F;Level0&#x2F;A&#x2F;Draft2" rel="nofollow noreferrer">https:&#x2F;&#x2F;wiki.commonjs.org&#x2F;wiki&#x2F;JSGI&#x2F;Level0&#x2F;A&#x2F;Draft2</a>
评论 #38060202 未加载
评论 #38060724 未加载
jcpstover 1 year ago
I used to do more node work, and that was mostly pre v4. Express was the go-to.<p>There’s more options out there now. I did a bit of research a few years back, and my go-to now is Fastify.<p><a href="https:&#x2F;&#x2F;fastify.dev&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;fastify.dev&#x2F;</a>
评论 #38059238 未加载
评论 #38059345 未加载
评论 #38066314 未加载
ThrowAway1922Aover 1 year ago
I love threads like this, it&#x27;s so stereotypical JS. OP asks if it&#x27;s the de-facto choice which it objectively is, but everyone recommends their pet project or favourite library instead.
评论 #38059907 未加载
评论 #38061721 未加载
评论 #38059784 未加载
评论 #38060524 未加载
vikR0001over 1 year ago
You might want to look at <a href="https:&#x2F;&#x2F;www.meteor.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.meteor.com&#x2F;</a>. There aren&#x27;t a lot of alternatives to it that do such a good job of providing its benefits:<p>- Zero-config build tool<p>- Accounts system included<p>- Live reactive data system included<p>- Easy interface to React, Svelte, Vue<p>- Can use its out-of-the box MongoDB integration or integrate with any database via GraphQL<p>- Great community forum<p>A new version 3.0 is almost done.
评论 #38114216 未加载
willsmith72over 1 year ago
I did the same research a few months ago. There are a lot of really cool alternatives which is fun and exciting, but at the end of the day I went with express. It&#x27;s super stable, huge community, endless online tutorials and content.<p>The most tempting alternatives were hono and fastify. Hono felt not mature enough.<p>At the end of the day your server framework is very rarely the bottleneck in your system&#x27;s performance, so it matters less.
pier25over 1 year ago
It&#x27;s still the most popular but for the past couple of years it hasn&#x27;t seen any major updates and some people question if the project is abandoned.<p>I switched to Fastify and haven&#x27;t looked back.
评论 #38059502 未加载
Zealotuxover 1 year ago
Yes it is, Bun is promising but still in early stage. If you&#x27;re looking for a battle-tested framework I would suggest Nest.js, which supports both Express and Fastify in a virtually transparent way.
评论 #38059694 未加载
holden_nelsonover 1 year ago
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.
评论 #38059300 未加载
评论 #38059746 未加载
评论 #38059171 未加载
Rapzidover 1 year ago
I mean, it depends on who your asking. Express has effectively been abandoned.<p>In 2023 many would recommend Fastify as a go-to.
评论 #38059622 未加载
评论 #38059709 未加载
bjablonskiover 1 year ago
I&#x27;d definitely suggest at least considering Nest.JS. There&#x27;s totally nothing wrong with Express (or Koa or Fastify) projects, but Express based projects tend to share problems with all others based on minimalistic-based frameworks - no skeleton means tons of discussions about favorite ORM, Logger, Validation, whole story about service vs helpers etc. If I can skip it, I always do. Decision paralysis can be a killer.
评论 #38059428 未加载
roblhover 1 year ago
It seems like it. There are alternatives like Koa and Fastify, but none of seem to strike quite the balance that express does. I pray that one day express 5 will get released and they’ll finally fix the whole async middleware not handling errors properly thing though. That’s gotta be one of the most annoying quirks that has just been quietly sitting there untouched for years at this point. Maybe one day.<p>I guess there’s Bun and Elysia now too, but that’s pretty bleeding edge by comparison.
评论 #38059500 未加载
johnchristopherover 1 year ago
Wait... wasn&#x27;t koa supposed to replace express ? What happened to it (and hapi) ?
chrisweeklyover 1 year ago
If you&#x27;re sure you want a traditional strictly-serverside backend, Fastify is like an improved Express. But your project&#x27;s success might depend on going beyond a hasty sanity-check that presupposes app architecture. What&#x27;s your front-end look like? For React, using a framework like Remix (or Next.js) that spans client and server runtimes, could make Fastify&#x2F;Express potentially moot.
husarcikover 1 year ago
I&#x27;d say adonis is the best now as you can iterate to a full product very quickly.<p>It&#x27;s full stack but still amazingly fast (comparable to fastify). You can choose what you need in order to improve speed too. The syntax mimics Laravel which is the easiest to use, most complete full stack framework of any language.<p>Obviously, somewhat opinionated claims and my main job isn&#x27;t programming so take it for what it&#x27;s worth.
评论 #38059340 未加载
jokullover 1 year ago
No - please check out Hono <a href="https:&#x2F;&#x2F;github.com&#x2F;honojs&#x2F;hono">https:&#x2F;&#x2F;github.com&#x2F;honojs&#x2F;hono</a>
评论 #38059249 未加载
评论 #38059593 未加载
评论 #38059979 未加载
KomoDover 1 year ago
There&#x27;s Fastify but I still prefer Express.
评论 #38060419 未加载
runarbergover 1 year ago
Follow-up question: Is there any backend framework which uses the fetch API. That is, where requests are standard Request objects (<a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Request" rel="nofollow noreferrer">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Request</a>) and where you send (or return, or yield) standard Response objects (<a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Response" rel="nofollow noreferrer">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Response</a>)?<p>I’m teaching a highschool kid web development and it would be very nice to be able to teach the same standard on the back end as we use on the front end.
评论 #38060145 未加载
评论 #38059724 未加载
评论 #38059789 未加载
thehutcheryover 1 year ago
I feel like it&#x27;s a matter of the beast you know vs working with something new. A lot of packages of been created to work with express so when working with it you get a larger ecosystem available to you. However, I think it&#x27;s akin to React for frontend where just because it&#x27;s the standard for node these days doesn&#x27;t mean it should be
debug-desperadoover 1 year ago
I&#x27;ve been on various projects that utilized Express, Koa, and NestJS (which wraps Express or Fastify).<p>Of the three, I&#x27;d choose Koa again over the others. Their design works better with modern javascript (async&#x2F;await). While there may be fewer middleware packages for Koa than Express, it&#x27;s usually not that hard to write your own if you can&#x27;t find what you need.<p>For NestJS I didn&#x27;t care for the decorator-driven &quot;Spring-like&quot; design. In JS codebases it&#x27;s more natural to take a functional approach.
jeromemaciasover 1 year ago
Fastify is definitely the new Express for me. I use it in production since many years !<p>Fastify main contributors are Nodejs contributors and help Nodejs language to be better and better.<p>I really never understood how in 2023 Express can still be the de-facto and included in so many beginner’s tutorials…
tootieover 1 year ago
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.
评论 #38059732 未加载
评论 #38060059 未加载
citrusxover 1 year ago
Express is still the &quot;go-to&quot; now, because it&#x27;s the rare case of a Node library that&#x27;s stable, battle-tested, and doesn&#x27;t change much. (Yes, the maintainers having not been able to release v5 has actually been a sort of advantage.)<p>But, there are other great options to go with now, and you probably won&#x27;t go wrong with fastify or hapi.
maxsavinover 1 year ago
<a href="https:&#x2F;&#x2F;www.hackernewsdaily.com" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.hackernewsdaily.com</a> is built on Meteor - haven&#x27;t touched it for years and its working great<p>really easy to update apps too
mjmasnover 1 year ago
I tend to use hapi (<a href="https:&#x2F;&#x2F;hapi.dev" rel="nofollow noreferrer">https:&#x2F;&#x2F;hapi.dev</a>) instead of Express if I need to write a quick backend for something these days.<p>Fastify looks nice too but I haven&#x27;t used it.<p>Been burnt by full-stack frameworks in the past (e.g. Meteor) but they can be a good option for some.
评论 #38112774 未加载
invitromover 1 year ago
Proven, reliable and still good.
austin-cheneyover 1 year ago
I just use the native Node APIs and write the tools I need when I need such tools. The really tough problems I would need something like Express to solve for are not solved by something like Express.
luastonedover 1 year ago
Express is outdated (in terms of active development).<p>I prefer Fastify since it has very good schema validation and error handling built in.
评论 #38059330 未加载
评论 #38059333 未加载
latchkeyover 1 year ago
All of the responses talk about a framework and I know you&#x27;re thinking you need one too. But, I&#x27;m more curious about your plans to host things.<p>The reason I ask is because there are alternatives, like Google Cloud Functions [0], where you don&#x27;t need a framework at all. You just write a handler and you&#x27;re done. Connect it with Github actions for deployment.<p>There are other services out there, but I like GCF cause it&#x27;ll auto scale. Need a database? Cloud SQL Postgres. Need a queue... Cloud Tasks... etc... so many problems solved in a relatively non-vendor lockin way.<p>EDIT: I&#x27;m getting downvoted for trying to make a helpful comment to the OP. Good work HN!<p>[0] <a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;functions&#x2F;docs&#x2F;console-quickstart" rel="nofollow noreferrer">https:&#x2F;&#x2F;cloud.google.com&#x2F;functions&#x2F;docs&#x2F;console-quickstart</a>
colesantiagoover 1 year ago
Last I checked, Express is extremely slow and will significantly impact your SEO if you&#x27;re a content business and doesn&#x27;t really scale very well if you get huge amounts of traffic like I have.<p>These days I use Go, Deno or Crystal which is much faster.<p>For hosting I recommend Cloudflare Pages, Vercel, (maybe Netlify) and Render.
评论 #38059322 未加载
评论 #38059286 未加载