Skip to content

Instantly share code, notes, and snippets.

@TharmiganK
Last active August 2, 2023 04:54
Show Gist options
  • Save TharmiganK/20b59233b69d5b50abb6869e8afba1a5 to your computer and use it in GitHub Desktop.
Save TharmiganK/20b59233b69d5b50abb6869e8afba1a5 to your computer and use it in GitHub Desktop.
Conference Service Main
import ballerina/log;
import ballerina/http;
import ballerina/lang.runtime;
configurable int conferenceServicePort = ?;
public function main() returns error? {
http:Listener conferenceListener = check new (conferenceServicePort);
log:printInfo("Starting the listener...");
// Attach the service to the listener.
check conferenceListener.attach(check new ConferenceService());
// Start the listener.
check conferenceListener.'start();
// Register the listener dynamically.
runtime:registerListener(conferenceListener);
log:printInfo("Startup completed. " +
string`Listening on: http://localhost:${conferenceServicePort}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment