added cors middleware
This commit is contained in:
parent
c71d933d5b
commit
cdceda30c9
1 changed files with 4 additions and 0 deletions
|
@ -811,6 +811,10 @@ int main(int argc, char **argv)
|
|||
|
||||
Server svr;
|
||||
|
||||
svr.set_default_headers({{"Server", "llama.cpp"},
|
||||
{"Access-Control-Allow-Origin", "*"},
|
||||
{"Access-Control-Allow-Headers", "content-type"}});
|
||||
|
||||
svr.Get("/", [&](const Request & /*req*/, Response &res)
|
||||
{ res.set_content(index_html_, "text/html"); });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue