From 61ef0bea4a16c2afb7fc2083aa0f7475a4b77b7c Mon Sep 17 00:00:00 2001 From: Rogier Lommers Date: Sun, 15 Feb 2015 14:04:44 +0100 Subject: [PATCH] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d4b9eca8..e4c1ec2d 100644 --- a/README.md +++ b/README.md @@ -331,7 +331,6 @@ func main() { ``` ####Serving static files - Use Engine.ServeFiles(path string, root http.FileSystem): ```go @@ -344,6 +343,13 @@ func main() { } ``` +Use the following example to serve static files at top level route of your domain. Files are being served from directory ./html. + +``` +r := gin.Default() +r.Use(static.Serve("/", static.LocalFile("html", false))) +``` + Note: this will use `httpNotFound` instead of the Router's `NotFound` handler. ####HTML rendering