Last active
August 2, 2023 04:54
-
-
Save TharmiganK/20b59233b69d5b50abb6869e8afba1a5 to your computer and use it in GitHub Desktop.
Conference Service Main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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