Frontend/Backend
Explore the relationship between the Frontend and the Backend. You'll run simple API's in terminal, and access them from the browser using asynchronous calls with Axios.js.
Index
Learning Objectives
- Frontend/Backend relations
- Cross Origin Resource Sharing
- Environmental Variables
- Promises (cooler callbacks)
Specifications
- Run the Frontend/Backend projects locally to figure out what's going on.
- Clone this repo
- Run the API of your choice in the terminal (ie. node ./0-frontend-backend/backends/take-your-pick)
- Open the Frontend in your browser (ie. ./0-frontend-backend/frontend/index.html)
- Follow the documentation in the browser to access the API you're running.
- (It's important to use the api_connection object because the browser can only send "get" requests from the url tab.)
- Build a new and pretty Frontend (HTML/CSS/JS) for the "api_connection" object provided as sample code, you can do it for whichever API you like most. (We recommend copying the file so you have the original as reference.)
- Deploy at least one of the provided backends to Heroku.
- Make a repository to host this project. Run the frontend you built on gh-pages, it will connect with your Heroku deployment.
Challenge:
- Turn all 4 backends into a single service-based backend and deploy that to Heroku. Have a frontend with 4 pages, one for each backend.
Resources
Frontend vs Backend:
Promises:
CORS:
Environmental Variables: