1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-26 03:20:08 +02:00
echo/website/content/guide/customization.md
Vishal Rana 0176385654 Moved examples to recipes
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-10-08 20:10:55 -07:00

709 B

title menu
Customization
side
parent weight
guide 2

HTTP error handler

Echo.SetHTTPErrorHandler(h HTTPErrorHandler)

Registers a custom Echo.HTTPErrorHandler.

Default handler rules:

  • If error is of type Echo.HTTPError it sends HTTP response with status code HTTPError.Code and message HTTPError.Message.
  • Else it sends 500 - Internal Server Error.
  • If debug mode is enabled, it uses error.Error() as status message.

Debug

Echo.SetDebug(on bool)

Enables/disables debug mode.

Disable colored log

Echo.DisableColoredLog()

StripTrailingSlash

StripTrailingSlash enables removing trailing slash from the request path.

e.StripTrailingSlash()