Skip to content

Integrate client-side requests with server endpoints for calculations #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shen-po-heng
Copy link

Hi, I'm taking this course "Developing AI Applications with Python and Flask" on Coursera. On this practice "Hands-on Lab: Building and Deploying a Web App using Flask App", I followed the instruction to build Maths folder, made mathematics.py and wrote the code for the endpoints on server.py.

However, I found the code in mywebscript.js actually already handle the calculation itself. In the current setup, the JavaScript functions (runAddition, runSubtraction, and runMultiplication) are performing the calculations directly in the browser and are not calling the Flask API endpoints which will be defined (/sum, /sub, and /mul) in students' practices later.

To make the client side (HTML + JavaScript) actually call these Flask endpoints, I modified mywebscript.js to make HTTP requests to the server, which will then perform the calculations using the functions from the mathematics module which will be done by students on this course later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant