Little bit about course, since we are now using all those endpoints. Now, if you try to run your Angular seven app, except localhost like we are using local IP address to run this application, it won't load. Let's investigate it using developer tool. And what's what's happening here. And we see the request access XML HTTP request, which is calling all those endpoints are getting blocked by cause policy, so it says no access control allow origin header is present on the requested resource. So since earlier, we were running the app using local hosts, so it was fine.
Now we are not using local host any more button local IP address to run the app. So let's let's examine lambda function and What What is missing VPC our lambda we haven't defined any cost policy here. So, what you have to do is you have to add a cross origin policy here. So, for the sake of convenience and you can actually use a lot of access control allow origin and course policy in this context what we are going to do is allow all the origins to localhost any IP address or any user can access our endpoint. You can choose to block your access by domain name or IP address. So a specific domain name or specific IP address can only use your endpoints and we can configure that but for the simplicity purpose, we are going to configure and allow all the origins so start.
Now once we have saved this lambda function, we are going to run the app again. And once we run the app again, we see that error has gone. And now we are able to load and use our endpoint successfully. So a little bit and if you are having the same problem, you need to update all your lambda functions with cost policy. Now, a little bit about the cross origin resource setting. So course, is just it's a kind of mechanism where you allow your incoming requests.
So it can be your domain, it can be your s3 bucket, it can be you know, your any, any other front end application. So it just runs on request response model of just just a couple of other jargons pre flight request pre flight response. But those endpoints actually allow on the base of the cost policy and if you haven't got your costs sorted out, you might run into this course issue. So, in the future just remember this. It's a it's a big topic in itself. But let's let's not worry about this at this point of time.