diff --git a/ui2/.devcontainer.json b/ui2/.devcontainer.json new file mode 100644 index 0000000..ee6f540 --- /dev/null +++ b/ui2/.devcontainer.json @@ -0,0 +1,4 @@ +{ + "image": "ballerina/ballerina-devcontainer:2201.3.1", + "extensions": ["WSO2.ballerina"], +} diff --git a/ui2/.gitignore b/ui2/.gitignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/ui2/.gitignore @@ -0,0 +1 @@ +target diff --git a/ui2/Ballerina.toml b/ui2/Ballerina.toml new file mode 100644 index 0000000..b35b488 --- /dev/null +++ b/ui2/Ballerina.toml @@ -0,0 +1,9 @@ +[build-options] + observabilityIncluded = true + +[package] + distribution = "2201.3.1" + name = "empty_sample" + org = "selvaratnamuthaiyashankar" + version = "0.1.0" + diff --git a/ui2/Cloud.toml b/ui2/Cloud.toml new file mode 100644 index 0000000..09831ec --- /dev/null +++ b/ui2/Cloud.toml @@ -0,0 +1,4 @@ +[settings] + buildImage = false + thinJar = false + diff --git a/ui2/service.bal b/ui2/service.bal new file mode 100644 index 0000000..90f6a0c --- /dev/null +++ b/ui2/service.bal @@ -0,0 +1,17 @@ +import ballerina/http; + +# A service representing a network-accessible API +# bound to port `9090`. +service / on new http:Listener(9090) { + + # A resource for generating greetings + # + name - the input string name + # + return - string name with hello message or error + resource function get greeting(string name) returns string|error { + // Send a response back to the caller. + if name is "" { + return error("name should not be empty!"); + } + return "Hello, " + name; + } +}