thegreenwebfoundation / greencheck-api

The green web foundation API
https://www.thegreenwebfoundation.org/
Apache License 2.0
9 stars 3 forks source link

Add simple redirect #19

Closed mrchrisadams closed 5 years ago

mrchrisadams commented 5 years ago

Right now, hitting /greencheck with no slash at the end triggers a 404, giving a traceback like so:

Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /greencheck

This fills up our error catcher, so we want to stop this happening.

one solution - add a redirect url for /greencheck to /greencheck/

We could add a redirect route. This would stop triggering the 404.

https://github.com/thegreenwebfoundation/thegreenwebfoundation/blob/master/apps/api/src/Controller/DefaultController.php#L98

It's not the only solution, but would be a good first issue.