-
Notifications
You must be signed in to change notification settings - Fork 753
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
[Task]: Implement sample Synapse API to Ballerina service mapping #43527
Labels
Comments
ballerina-bot
added
the
Team/jBallerina
All the issues related to BIR, JVM backend code generation and runtime
label
Oct 28, 2024
Update:
Identified concerns:
|
[Update on 08/11/2024]
import ballerina/http;
import ballerina/log;
listener http:Listener HealthcareAPI = new (8290, config = {host: "localhost"});
service /healthcare on HealthcareAPI {
resource function post categories/[string category]/reserve(http:Caller caller, http:Request req) returns error? {
json payload = check req.getJsonPayload();
string Hospital = check payload.hospital;
http:Response res;
match Hospital {
"grand oak community hospital" => {
log:printInfo("", message = "Routing to " + Hospital);
http:Client GrandOakEP = check new (string `http://localhost:9090/grandoaks/categories/${category}/reserve`);
res = check GrandOakEP->post("", req);
}
"pine valley community hospital" => {
log:printInfo("", message = "Routing to " + Hospital);
http:Client PineValleyEP = check new (string `http://localhost:9090/pinevalley/categories/${category}/reserve`);
res = check PineValleyEP->post("", req);
}
"clemency medical center" => {
log:printInfo("", message = "Routing to " + Hospital);
http:Client ClemencyEP = check new (string `http://localhost:9090/clemency/categories/${category}/reserve`);
res = check ClemencyEP->post("", req);
}
_ => {
log:printInfo("", message = "Invalid hospital - " + Hospital);
res = new;
res.setPayload(payload);
}
}
check caller->respond(res);
}
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description
$subject
Describe your task(s)
No response
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: