LuvDaSun / SkiffaGenerator

ISC License
2 stars 2 forks source link

Better handling of unknown routes #102

Closed mgm1313 closed 2 weeks ago

mgm1313 commented 1 month ago

Currently, if a user makes a request to an endpoint that is not defined (https://serverurl.com/non-existing-route), the server simply closes the connection. I think it would be more intuitive to give a 404.

mgm1313 commented 1 month ago

Ah I just found out that's what the server.registerMiddleware(api.lib.createErrorMiddleware()) is for.. Might need some documentation :)

elmerbulthuis commented 2 weeks ago

yup!

the error middleware makes http friendly errors from internal errors!

so use that :-)