I’ve been wondering about Nodejs/Server Side languages for a while now. What is it used for exactly? I know can be used for hosting with routing. But I can do that with github pages. I know it can be used for apis, but usually in an app you aren’t making an api, right? Is it really only for use with mongodb? Thanks for the info.
Think of this, every morning your app goes and checks wheather somewhere on Mars and adjust css theme accordingly; or your app wants to store something privately; or you want to develope app in modular approach and then bundle all the code… this is just a few examples
Can’t you use js to do some of that, or is it that its easier node?
You can do command line apps, a backend for your website, or anything.
Just to give you an example, image a form validation, generally you do it in the frontend so it’s easier for your users to see what’s wrong in real time. But you must validate on the server (because the client is never safe). With node, you write that validation in one place and both the client and the server can use it.
My question was really server side in general, not just the node language. i’ll edit my question above.
Jumped from Laravel to NodeJS never felt happier in my coding world.
You need server side for anything but the very basic. Suppose this forum, you need server side to store every profile, every topic, every message, every likes, shares, reports and bookmarks.
Every one of those things also needs to be validated, you can’t allow a person to send more than one like per post for example. And you can’t trust the client (frontend) to validate it. Every client, be it a website or a software app running in your desktop, isn’t trustable because someone is running the code (your app) in their computer, they can modify that code to do what they want.
The only thing you can trust is your backend, because it is running your code in your server. So you must validate everything the client sends to you.
I’m probably going overboard here, you should create an app that uses frontend and backend so you’ll understand it better. Search a tutorial that shows you how to create a “CRUD” app, it is the simplest form of interaction between frontend and backend, you’ll learn a lot.
Nope, that was perfect. Thanks a lot.