Skip to content

NotFoundHandler: panic: echo: unknown handler #53

Closed
@ivoviz

Description

@ivoviz

The following code fails with panic: echo: unknown handler line 16: e.NotFoundHandler(index)

package main

import (
    "net/http"
    "github.com/labstack/echo"
)

func index(c *echo.Context) {
    c.HTML(http.StatusOK, "<html></html>")
}

func main() {
    e := echo.New()
    e.NotFoundHandler(index)
    e.Run(":1234")
}

I have an older version of echo (54d2f72) and with that the code above works just fine. Could this be a bug or am I missing something?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions