void main()
{
    auto router = new URLRouter;
router.get("/", serveStaticFiles("D:\\code\\onlineTest\\index.html")); router.get("/admin", serveStaticFiles("D:\\code\\onlineTest\\admin.html"));
    router.any("/foo", &foo);

    auto settings = new HTTPServerSettings;
    settings.port = 8080;
    settings.bindAddresses = ["::", "127.0.0.1"];
    settings.sessionStore = new MemorySessionStore; // SESSION
}


void foo(HTTPServerRequest req, HTTPServerResponse res)
{
    if (req.session)
    {
       res.writeBody("Hello, World!", "text/plain");
    }
}

Before showing foo I can check session status. But How to check session status for static /admin page?


Reply via email to