francescovallone / serinus

Serinus is a minimalistic framework for building efficient and scalable backend applications powered by Dart. 🎯
https://serinus.app
MIT License
41 stars 3 forks source link

feat(#74): allow passing Path Parameters as handler parameters - closes #74 #88

Closed francescovallone closed 1 month ago

francescovallone commented 1 month ago

Description

Allow passing path parameters as handler parameters. From this point forward both the previous version and this are accepted by Serinus. This means both these handlers are accepted by the framework.

    on(
      TestRoute(path: '/path/<value>'),
      (context) async {
        return context.params['value'];
      },
    );
    on(
      TestRoute(path: '/path/<value>'),
      (RequestContext context, String value) async {
        return value;
      },
    );

Fixes #74

Type of change

Please delete options that are not relevant.

Checklist:

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.83%. Comparing base (cfbbf65) to head (b1ab755). Report is 11 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #88 +/- ## =========================================== + Coverage 89.75% 89.83% +0.08% =========================================== Files 73 73 Lines 2605 2626 +21 =========================================== + Hits 2338 2359 +21 Misses 267 267 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.