Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTTP default listener #2289

Merged
merged 5 commits into from
Jan 31, 2025
Merged

Add HTTP default listener #2289

merged 5 commits into from
Jan 31, 2025

Conversation

TharmiganK
Copy link
Contributor

@TharmiganK TharmiganK commented Jan 30, 2025

Purpose

$Subject

Fixes: ballerina-platform/ballerina-library#7514

Mock central page: https://central.ballerina.io/tharmigank/http/0.6.0

Examples

import ballerina/http;

listener http:Listener httpListener = http:getDefaultListener();

service /api/v1 on httpListener {

    resource function get greeting() returns string {
        return "Hello, World from Service 1!";
    }
}

The port and listener configuration of the default listener can be changed in the Config.toml as follows:

[ballerina.http]
defaultListenerPort = 8080

[ballerina.http.defaultListenerConfig]
httpVersion = "1.1"

[ballerina.http.defaultListenerConfig.secureSocket.key]
path = "resources/certs/ballerinaKeystore.p12"
password = "ballerina"

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility
  • Checked the impact on OpenAPI generation

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.88%. Comparing base (ebfea77) to head (e4acd20).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
ballerina/http_default_listener.bal 87.50% 1 Missing ⚠️

❌ Your project status has failed because the head coverage (79.88%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2289      +/-   ##
============================================
- Coverage     80.42%   79.88%   -0.54%     
- Complexity        0      678     +678     
============================================
  Files           366      418      +52     
  Lines         20752    23127    +2375     
  Branches       3290     3752     +462     
============================================
+ Hits          16689    18475    +1786     
- Misses         3128     3516     +388     
- Partials        935     1136     +201     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TharmiganK TharmiganK merged commit 21d883b into master Jan 31, 2025
7 of 8 checks passed
@TharmiganK TharmiganK deleted the default-listener branch January 31, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add HTTP default listener
2 participants