A
A
Alex102142021-05-12 14:16:33
Angular
Alex10214, 2021-05-12 14:16:33

How to use Nodejs correctly?

Hello everyone, I need advice or explanations. I have a project written in Angular and also have a mysql database. I have a task using nodejs to make requests. I bought courses on node.js and expresjs, but everything is without angular. We conditionally created an empty folder and started installing express in it and so on. As I understand it, I need to install expressjs in an angular project and knock on the database? or what is the right way to interact with Angular and expressjs? Tell me pliz ((Only more or less detailed, if possible.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
babtsoualiaksandr, 2021-05-12
@babtsoualiaksandr

As an elegant option on TS
https://habr.com/ru/post/471348/

V
Vladimir, 2021-05-14
@Casufi

Flies separately, cutlets separately. You need to make a RESTFULL API server on a node and connect your api to Angular.
If you don’t want to mess around with CORS, you need to use the proxy function of webpack during development, and in production configure nginx to give api on a subfolder of your domain
To sum up, all the lessons you watched are absolutely correct, you don’t need to think about angular API development

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question