This commit is contained in:
parent
130ae630aa
commit
3392f8a0b3
@ -8,7 +8,7 @@ DBO_INSTANTIATE_TEMPLATES(MyMessage)
|
||||
|
||||
DbStruct *m_dbStruct;
|
||||
|
||||
void JsonResource::handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) {
|
||||
void AuthenticationResource::handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) {
|
||||
response.setMimeType("application/json");
|
||||
response.addHeader("Server", "Wt");
|
||||
|
||||
|
@ -44,7 +44,7 @@ struct DbStruct {
|
||||
std::uniform_int_distribution<int> distribution;
|
||||
};
|
||||
|
||||
class JsonResource : public Wt::WResource {
|
||||
class AuthenticationResource : public Wt::WResource {
|
||||
public:
|
||||
void handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response) final;
|
||||
};
|
||||
|
@ -30,7 +30,7 @@ WebApplication::WebApplication() {
|
||||
m_server = std::make_unique<Wt::WServer>("./build", args);
|
||||
m_server->addEntryPoint(Wt::EntryPointType::Application, createApplication, "/hello");
|
||||
m_server->addEntryPoint(Wt::EntryPointType::WidgetSet, createWidgetSet, "/gui/hello.js");
|
||||
m_server->addResource(std::make_shared<JsonResource>(), "/json");
|
||||
m_server->addResource(std::make_shared<AuthenticationResource>(), "/auth");
|
||||
m_server->addResource(std::make_shared<PlaintextResource>(), "/plaintext");
|
||||
m_server->addResource(std::make_shared<DbResource>("database.sqlite"), "/db");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user