79398542

Date: 2025-01-30 00:50:37
Score: 0.5
Natty:
Report link

You were right to say express.js is server-side and AngularJS is client-side but, when you said AngularJS can do everything express.js can do, then you are wrong.

The modern AngularJS is now called Angular, so permit me to use it in a modern way.

The routing you see for both express.js and Angular works in seperate ways.

Here is their routing differences:

Express.js (Backend Routing): Decides which data or HTML the server should send based on the request (e.g., /users fetches user data).

Angular (Frontend Routing): Manages which view (page) to show without reloading the browser (e.g clicking a link changes the page instantly, but must fetch the data from whatever backend server it's depending on).

Think of it like this:

Express.js: Server traffic controller (delivers data by processing or fetching database data, and sending it to the frontend via a defined route/api)

Angular: Browser page switcher (changes UI without reloading).

If you don't define a route in express.js, and you point a link from your Angular (frontend), you will be lead to a 404.

Now let's answer your confusion for Node.js, here are their definitions and differences:

Node.js: A backend runtime that runs JavaScript on the server. It handles database interactions, authentication, and business logic.

Express.js: A backend framework based on Node.js that helps manage routes, APIs, and server logic. Think of it as a tool that makes backend development easier (or jquery to JavaScript on the server side. Without Node.js, express.js can't work)

AngularJS/Angular: Frontend frameworks that build interactive user interfaces (UI) running in the browser. They handle how users see and interact with a website.

Let me break something interesting for you, when you see a website built with Angular and assume the backend is runned by express.js, here is how it all makeup the workflow:

° Hosting hardware >

° Install an OS >

° Install and run an environment +

° Install a web server >

° Install express.js >

° Install Angular

The only visible part users of your website can interact with directly default is the Angular except there's a server misconfiguration or bug.

Note, the running environment and web server have the same system privileges.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Daniel