Getting to work
Now that we’ve got a general picture of our projects, it’s time to do something. Let’s start with two simple exercises that will also come in handy in the future. The first of these will involve the server-side endpoints of our Web API project, while the second will affect the client-side user experience of our Angular app. Both will help us to ensure we have really understood everything there is to know before proceeding to subsequent chapters.
Changing the API endpoints
If we take another look at Angular’s proxy.conf.js
file, we can easily see that the only existing rule is explicitly mapping the single action method of our Web API:
const PROXY_CONFIG = [
{
context: [
"/weatherforecast",
],
target: "https://localhost:40443",
secure: false
}
]
module.exports = PROXY_CONFIG;
This might be OK for our initial testing purposes, but it can become a very impractical approach as soon...