mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 10:22:52 +01:00
Pass HTTP method & path to dispatch()
This commit is contained in:
parent
a697ec382e
commit
db8e4ea1aa
@ -37,7 +37,7 @@ void HttpServer::run()
|
||||
std::string http_method = regex_match.str(1);
|
||||
std::string http_path = regex_match.str(2);
|
||||
|
||||
std::string response = dispatch();
|
||||
std::string response = dispatch(http_method, http_path);
|
||||
client.send(response.c_str(), response.size());
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ void HttpServer::run()
|
||||
listener.close();
|
||||
}
|
||||
|
||||
std::string HttpServer::dispatch()
|
||||
std::string HttpServer::dispatch(std::string method, std::string path)
|
||||
{
|
||||
return "HTTP/1.1 200 OK\n\n<h1>HELLO FROM OPENRW</h1>";
|
||||
}
|
||||
|
@ -30,5 +30,5 @@ private:
|
||||
RWGame* game;
|
||||
GameWorld* world;
|
||||
|
||||
std::string dispatch();
|
||||
std::string dispatch(std::string method, std::string path);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user