diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 3bf985957..2a492bdc9 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -889,7 +889,14 @@ int main(int argc, char ** argv) { }); svr.Get("/", [](const Request &, Response & res) { - res.set_content("

llama.cpp server works

", "text/html"); + // return content of server.html file + + std::ifstream t("examples/server/server.html"); + std::stringstream buffer; + buffer << t.rdbuf(); + + res.set_content(buffer.str(), "text/html"); + return false; }); svr.Post("/completion", [&llama](const Request & req, Response & res) { diff --git a/examples/server/server.html b/examples/server/server.html new file mode 100644 index 000000000..44b8db263 --- /dev/null +++ b/examples/server/server.html @@ -0,0 +1,287 @@ + + + + Llama.cpp + + + llama.cpp - chat + + + + + + + + + + + + \ No newline at end of file