I am building an Angular app, a School's Material Reservation System.
So far I implemented the frontend. Now it is time to build the backend with mySql and node.js.
So far, I realised the server.ts is not used at all during npm start. Instead it uses in-built stuff and launch.json.
But!!! The backend requires me to set the api endpoints in server.ts, and further develop services and use those services in components to fetch my data from the mySQL database.
You want to tell me I always need to build for production to test my connection between my front-end and my back-end?
Am I getting this all wrong? Is my process incorrect? Please someone clarify this to me.
To clarify, you do not need to build for production to test the connection between your front-end and back-end. You can run your Angular app locally and connect it to a local instance of your back-end server.
In your case, it seems that you need to set up the API endpoints in your server.ts file and develop services to fetch data from your MySQL database. Once you have set up your back-end server, you can run it locally and connect it to your Angular app.
To communicate between your front-end and back-end, you can use HTTP requests. Angular provides the HttpClient module, which allows you to make HTTP requests to your back-end server. You can create a service in Angular to handle the HTTP requests and use it in your components to fetch data from your back-end server.