Skip to content

Commit ef77177

Browse files
committed
trying to serve index.html on / path
1 parent 3177142 commit ef77177

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

web.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,13 @@ func routeHandler(req *Request, c conn) {
311311

312312
return
313313
}
314-
314+
315+
//try to serve index.html
316+
if indexPath := path.Join(staticDir, "index.html"); requestPath == "/" && fileExists(indexPath) {
317+
serveFile(&ctx, indexPath)
318+
return
319+
}
320+
315321
ctx.Abort(404, "Page not found")
316322
}
317323

0 commit comments

Comments
 (0)