mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
15 lines
412 B
Go
15 lines
412 B
Go
package notfound
|
|
|
|
import (
|
|
"github.com/valyala/fasthttp"
|
|
)
|
|
|
|
// NewHandler creates handler missing requests handling.
|
|
func NewHandler() fasthttp.RequestHandler {
|
|
return func(ctx *fasthttp.RequestCtx) {
|
|
ctx.SetContentType("text/plain; charset=utf-8")
|
|
ctx.SetStatusCode(fasthttp.StatusNotFound)
|
|
_, _ = ctx.WriteString("Wrong request URL. Error pages are available at the following URLs: /{code}.html")
|
|
}
|
|
}
|