Skip to content

Instantly share code, notes, and snippets.

@raj-rajaratnam
Created September 15, 2018 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raj-rajaratnam/83ca68da1a68985855e0ba815be2453f to your computer and use it in GitHub Desktop.
Save raj-rajaratnam/83ca68da1a68985855e0ba815be2453f to your computer and use it in GitHub Desktop.
import ballerina/http;
import ballerina/log;
import ballerinax/docker;
@docker:Expose{}
endpoint http:Listener utilityEp {
port:8280
};
@docker:Config {
name:"utility",
tag:"v2"
}
@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