Google Cloud Professional Cloud Developer — Question 171
You are responsible for deploying a new API. That API will have three different URL paths:
• https://yourcompany.com/students
• https://yourcompany.com/teachers
• https://yourcompany.com/classes
You need to configure each API URL path to invoke a different function in your code. What should you do?
Answer options
- A. Create one Cloud Function as a backend service exposed using an HTTPS load balancer.
- B. Create three Cloud Functions exposed directly.
- C. Create one Cloud Function exposed directly.
- D. Create three Cloud Functions as three backend services exposed using an HTTPS load balancer.
Correct answer: D
Explanation
The correct answer is D because creating three Cloud Functions as separate backend services allows each URL path to invoke its corresponding function effectively. Options A and C do not provide the necessary separation of functions for each path, while option B lacks the benefits of using a load balancer for scalability and management.