VeryGoodOpenSource / dart_frog

A fast, minimalistic backend framework for Dart 🎯
https://dartfrog.vgv.dev
MIT License
1.84k stars 148 forks source link

feat: http method routing #546

Open marionegroponzi opened 1 year ago

marionegroponzi commented 1 year ago

Intro

I know you do not accept feature request, but this is about adding a class that has already been written (not by me) that I believe would add a nice touch to the project.

Description

Today routes require to explicitly check for the HTTP method of the request. I'd like to have an idiomatic way to automatically reject unsupported methods without adding a lot of boilerplate.

I've found this article that offers a nice implementation (the article is in Spanish but the code is easy to understand).

Would it make sense to integrate it? Or do you have another solution in mind?

And if there's already a better alternative I must have missed in the documentation ;)

Requirements

shivashankar16041990 commented 1 year ago

you can use if else

wolfenrain commented 1 year ago

For reference on ideas and discussions: https://github.com/VeryGoodOpenSource/dart_frog/issues/57