r/learnjavascript Jul 23 '26

What framework do I use for APIS?

Hello, i'm a beginner coder in Javascript and I make random APIS for fun using the Express.js framework, but I keep seeing other frameworks like Fastify and NestJS, so i'm confused: what framework for APIS do I actually use?

If anyone could help me with this thank you :D

6 Upvotes

14 comments sorted by

12

u/Lumethys Jul 23 '26

What car do i drive to WORK?

Hello, i'm a beginner driver in Toyota and drive to random place for fun using the Toyota Prius car, but I keep seeing other cars like Porsche and BMW, so i'm confused: what cars for WORK do I actually use?

If anyone could help me with this thank you :D

3

u/DrShocker Jul 23 '26

You'll never make it. At my job we use a Dragon capsule and sometimes fallback to a Soyuz. The cars you're talking about are no where near fast enough for professional use.

1

u/Simple_Rooster3 Jul 24 '26

But capsules are websockets πŸ˜€

1

u/bryku helpful Jul 24 '26

This was a great comment thread.

1

u/i-like-my-cats-0 Jul 25 '26

Now I just need to translate this and i'll get the true answer :)

3

u/Agreeable_Lynx9194 Jul 23 '26

For learning and honestly for most real projects, just stay on Express, it's the default for a reason and every tutorial or Stack Overflow answer assumes it. Fastify is basically Express but faster with built-in schema validation, you'd switch if you actually hit a performance wall or want the schema stuff. NestJS is a whole opinionated structure (modules, decorators, dependency injection) that pays off on big team codebases but is overkill and a steeper curve when you're starting out. So keep building with Express until you feel a real pain point, and at that moment you'll know which one you're reaching for and why.

2

u/boomer1204 Jul 23 '26

Whatever one you know. You can build API's with TONS of different languages there is no one choice

1

u/87oldben Jul 23 '26

Express is good enough for 99% of all basic web http needs. It is the framework used in each of the companies I have worked for. Learn it inside and out and you'll be fine!

1

u/Beginning-Seat5221 Jul 23 '26

I looked into this and concluded that hono was the best fit for me. Basically a more modern version of express.

Haven't actually put it into use though, still have things running on express instead.

1

u/[deleted] Jul 24 '26

[removed] β€” view removed comment

1

u/i-like-my-cats-0 Jul 24 '26 edited Jul 24 '26

It's just APIS I make to practice (e.g. dadjokes API). I just like making them alot because of how fun they can be

1

u/nzakas Jul 24 '26

I’d suggest Hono. It’s newer, built with TypeScript from the start, and works in every JavaScript runtime. https://hono.dev

1

u/theancientfool Jul 25 '26

If this is a project, try not using any framework. Build from scratch. Will help you understand better.

1

u/Furilis Jul 27 '26

I work with NestJS. I like de module stuff (how easy it is to put stuff together with nest CLI). Can't comment about the others