Sha256: 22ecdac03f0640409bb3459dc04e4a16ac864ed45ee7482229093509bf8d2f81

Contents?: true

Size: 593 Bytes

Versions: 11

Compression:

Stored size: 593 Bytes

Contents

import ballerina/http;
import ballerina/log;

// By default, Ballerina exposes a service via HTTP/1.1.
service<http:Service> hello bind { port: 9090 } {

    // Invoke all resources with arguments of server connector and request.
    sayHello(endpoint caller, http:Request req) {
        http:Response res = new;
        // Use a util method to set a string payload.
        res.setPayload("Hello, World!");

        // Send the response back to the caller.
        caller->respond(res) but { error e => log:printError(
                           "Error sending response", err = e) };
    }
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.179 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.178 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.177 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.176 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.175 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.174 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.173 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.172 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.171 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
trackler-2.2.1.170 tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal