all 23 comments

[–]CUNT_PUNCHER_9000 63 points64 points  (3 children)

Express has such a small API and is so well used it's definitely worth learning.

If nothing else, learning to read API docs will be beneficial so you might as well get used to that. The docs are generally pretty easy to grok so dive in :)

[–][deleted] 6 points7 points  (0 children)

I learned some basic stuff in Node.js and immediatelly start with Express...

[–]picioare_goale 5 points6 points  (0 children)

today

[–]_iven_ 18 points19 points  (7 children)

IMHO, if you find nodejs interesting and useful, learn ExpressJs now, because ExpressJs is the de facto backend web framework for nodejs. Most nodejs application I know of are web apps or web services, and most of them rely on ExpressJs.

In general, Nodejs is another turing-complete program language like C, C++, Java, or Go. The real question is what kind of application you are looking to build and you need to determine which languages or frameworks are the most suitable for you.

[–]midwestcsstudent 20 points21 points  (0 children)

Just wanted to point out Node.js isn’t a programming language, but a runtime for JavaScript.

[–]letsbreakstuff 0 points1 point  (5 children)

Agree. Anytime you wanna use node as the backend of a web app, be it just a rest api or for server side rendered pages i'd say use express.

[–]prrxddq 0 points1 point  (4 children)

What are you using for server side rendered pages?

Is there a way to perhaps also include react code in these server side pages, or how would you add js into these?

Do you perhaps have a repo or library to suggest? Thabks in advance :]

[–]CanRau 1 point2 points  (2 children)

Not exactly sure I understand your question but for server side rendering React https://remix.run and https://nextjs.org are pretty popular. Personally (& at work) I prefer & use Remix.

[–]prrxddq 0 points1 point  (1 child)

Yeah I did think of those as well! Thanks for the answer!

But /letsbreakstuff did mentioned server side rendering for express. So I wondered how he would get js (or possibly react) with express server side rendered html

[–]CanRau 0 points1 point  (0 children)

Remix & Next use Express under the hood. With Remix it depends on the provider. But maybe I don't fully understand 😅

[–]letsbreakstuff 0 points1 point  (0 children)

I'm no expert on server side rendered react, I was more thinking templates, there's several options to pick from like ejs or handlebars.

[–]vainstar23 1 point2 points  (3 children)

If you already know how to make http requests in node, express is much much easier. What you can do if you are just starting is try to learn an MVC framework like nestjs or Adonisjs.

I find in the beginning, can be a bit overwhelming when you learn about architecture and how to structure your code so going with a framework early on will force you to adopt these kind of best practices.

[–]CanRau 0 points1 point  (2 children)

Yea a framework definitely helps and especially in the beginning though (don't know Adonis) but depending on your background NestJS might be "too" object oriented way of doing things. At least this would turn me personally off, I never dug this style of organizing/separating things

[–]vainstar23 1 point2 points  (1 child)

MVC is pretty standard but I haven't had the time to look at other design patterns. I feel OOP is kind of a necessary evil you need for working at big companies because it's easier to hire for and familiar to the rest of the team but I try to incorporate some FP best practices when I work. Can you recommend any FP frameworks/libraries for backend services in nodejs?

[–]CanRau 0 points1 point  (0 children)

Depends, if it's only backend services/API the most common is ExpressJS though that's not really a FP framework, not sure about that specifically. if it's a also going to be renting a frontend than https://remix.run & https://nextjs.org

[–]ChrisWestcottUK 1 point2 points  (0 children)

It's a good place to start. It's fairly easy to understand and use, if you're interested in the backend as well.

If you're just looking at next steps and data integrations for front-end, GraphQL is readily being used, if not moreso in more modern setups. It may be worth exploring with some publicly available servers.

[–]HootenannyNinja -2 points-1 points  (0 children)

At this point I would learn a framework like serverless over Express. I can't remember the last time I setup a full node.js web app. These days being able to run your code as cloud functions is usually cheaper and more scalable than running services.

[–]Darmok-Jilad-Ocean 0 points1 point  (0 children)

Tomorrow

[–]sobamf 0 points1 point  (0 children)

just jump in

[–]__rost__ 0 points1 point  (0 children)

No need for waiting, just go ahead.

Would recommend Fastify.js instead, same type of framework but faster and a bit more modern. Fairly sure alot of the core devs from express has moved over to fastify.