Created
September 15, 2018 15:29
-
-
Save raj-rajaratnam/ff11da425674cd5ced63d340926c4201 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/http; | |
import ballerina/log; | |
import ballerinax/kubernetes; | |
@kubernetes:Ingress { | |
hostname:"ballerina.gateway.com" | |
} | |
@kubernetes:Service { | |
name:"utility", | |
serviceType:"NodePort" | |
} | |
endpoint http:Listener utilityEp { | |
port:8280 | |
}; | |
@kubernetes:Deployment { | |
image:"utility:v3", | |
enableLiveness:true | |
} | |
@http:ServiceConfig { | |
basePath:"/utility" | |
} | |
service<http:Service> Utility bind utilityEp { | |
@http:ResourceConfig { | |
methods:["GET"], | |
path: "/hello" | |
} | |
sayHello(endpoint outboundEp, http:Request req) { | |
http:Response res = new; | |
res.setTextPayload("Congratulations, let's dance! \n"); | |
outboundEp->respond(res) but { error e => log:printError("Error while responding", err = e) }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment