DEV Community

I Built and Deployed a REST API on WSO2 Choreo. Here's What Actually Happened.

I'd been hearing about WSO2 Choreo for a while but never actually tried it. Since I'm applying for the WSO2 Engineering internship, I figured the best way to understand what they build is to just use it. So I spent an afternoon building a URL shortener API with Ballerina and deploying it on Choreo. Not a tutorial. Just an honest first look.

What is Choreo?

Choreo is WSO2's cloud-native internal developer platform. You connect your GitHub repo, pick your language, and Choreo handles the build pipeline, deployment, and API gateway without you touching any of that manually. At least that's the pitch. I wanted to see if it actually worked that way.

What I Built

A simple URL shortener API with two endpoints:

  • POST /shorten takes a long URL and returns a short key
  • GET /resolve/{key} takes the key and returns the original URL

I wrote it in Ballerina, which is WSO2's own programming language built for network-aware applications. I had zero experience with it going in.

The Ballerina Part

Coming from Python and Java, Ballerina felt familiar but a bit different. The service syntax is clean and readable:

service / on new http:Listener(8080) {
    resource function post shorten(@http:Payload json body) returns json|error {
        string longUrl = check body.url;
        string key = uuid:createType1AsString().substring(0, 6);
        urlStore[key] = longUrl;
        return { "key": key, "short_url": "/resolve/" + key };
    }
}
Enter fullscreen mode Exit fullscreen mode

The check keyword handles error propagation automatically. No try/catch everywhere. It took me a few minutes to get my head around it but once it clicked, I actually liked it.

Deploying on Choreo

This is where I was expecting things to break. They didn't. After pushing to GitHub, I connected the repo in Choreo, selected Ballerina as the build preset, and hit deploy. Choreo detected the project structure, built it, and gave me a live public endpoint in a few minutes. No Dockerfile. No Kubernetes config. It also generated an API test console automatically so I could hit the endpoints right in the browser.

Both endpoints worked on the first try, which honestly surprised me.

Does it actually work?

Yes. POST returns a key, GET resolves it back. Live and working.

GitHub : Click Here

What I took away

Choreo removes a lot of deployment friction. Coming from manually wiring up Railway and Docker for my own projects, having the platform just figure it out was a different experience. I'm not sure I'd use it for everything, but for spinning up services quickly inside an organisation, it makes sense. I get the appeal now.

Top comments (0)