Skip to content

Commit 6ccdc2a

Browse files
committed
fixed README error
1 parent c27b95e commit 6ccdc2a

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

README.md

-22
Original file line numberDiff line numberDiff line change
@@ -242,25 +242,3 @@ handlers are registered with `Router.NotFound()`:
242242

243243
* `routing.MethodNotAllowedHandler`: a handler that sends an `Allow` HTTP header indicating the allowed HTTP methods for a requested URL
244244
* `routing.NotFoundHandler`: a handler triggering 404 HTTP error
245-
246-
247-
## Serving Static Files
248-
249-
Static files can be served with the help of `file.Server` and `file.Content` handlers. The former serves files
250-
under the specified directories, while the latter serves the content of a single file. For example,
251-
252-
```go
253-
import (
254-
"github.com/qiangxue/fasthttp-routing"
255-
"github.com/qiangxue/fasthttp-routing/file"
256-
)
257-
258-
router := routing.NewRouter()
259-
260-
// serve index file
261-
router.Get("/", file.Content("ui/index.html"))
262-
// serve files under the "ui" subdirectory
263-
router.Get("/*", file.Server(file.PathMap{
264-
"/": "/ui/",
265-
}))
266-
```

0 commit comments

Comments
 (0)