File tree 1 file changed +0
-22
lines changed
1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -242,25 +242,3 @@ handlers are registered with `Router.NotFound()`:
242
242
243
243
* ` routing.MethodNotAllowedHandler ` : a handler that sends an ` Allow ` HTTP header indicating the allowed HTTP methods for a requested URL
244
244
* ` 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
- ```
You can’t perform that action at this time.
0 commit comments