Skip to content

Commit 0934b51

Browse files
committed
server: redirect base path to ui
1 parent 2ac5e31 commit 0934b51

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/server/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,6 +1628,11 @@ void start_server(SDParams params) {
16281628
}
16291629
});
16301630

1631+
// redirect base url to index
1632+
svr->Get("/", [](const httplib::Request& req, httplib::Response& res) {
1633+
res.set_redirect("/index.html");
1634+
});
1635+
16311636
// bind HTTP listen port, run the HTTP server in a thread
16321637
if (!svr->bind_to_port(params.host, params.port)) {
16331638
// TODO: Error message

0 commit comments

Comments
 (0)