From the course: JavaScript: Ajax and Fetch
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Why are proxy servers necessary? - JavaScript Tutorial
From the course: JavaScript: Ajax and Fetch
Why are proxy servers necessary?
- [Instructor] Building out a basic Ajax request in front end code is a common practice when developing an app. It's a quick and easy process for trying out the request, writing code to work with the response and building out your app around that. But in many cases before you deploy an app for public use, it's necessary to set up a proxy server to handle your Ajax requests. So why are proxy servers necessary? A lot of APIs require the use of credentials like API keys. Without including a key in your request, the server returns a 401 error indicating that your app isn't authorized to access the requested data. To get authorization, you include your API key as part of your request either in the query string or as a header. This lets the web service associate your request with your account. As long as you're still below any quota or limit on your account, the service sends an OK response with the data included. The problem with this setup is that when you include your API key in the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Why are proxy servers necessary?3m 5s
-
(Locked)
Tools: Git, GitHub, and Heroku50s
-
(Locked)
Set up an app on Heroku2m 37s
-
(Locked)
Configure proxy options5m 9s
-
(Locked)
Deploy and test a proxy5m 58s
-
(Locked)
Configure proxy security6m 38s
-
(Locked)
Challenge: Customize code for an Ajax proxy1m 20s
-
(Locked)
Solution: Customize code for an Ajax proxy5m 56s
-
(Locked)
-