title: NodeJS / Express all requests to specific path
body: <p>I'm not looking to serve a static folder/files. That being cleared, here is my issue:</p>
  
  <p>I have a Login page, and after the user has been verified, I create a session.
  Based on this session, I want to give the client access/denial to every request they make to the url path <em>example.com/admin</em></p>
  
  <p>Why? I have API calls to this url but also a file inside /public/admin/dashboard.html (and yes the /public folder is served as a static folder) - and all of these incoming requests should just be possible from clients with verified sessions.</p>
  
  <p>I tried to use <code>app.get("/admin/*",...</code> but that seems also to affect all the other domains with get requests:</p>
  
  <pre><code>app.get("/admin/*", function(req, res) {
      if (req.session.email !== undefined) {
        console.log("User is verified to access");
        return res.redirect("/admin/dashboard.html");
      } else {
        console.log("Failed: User not verified, redirect to 404");
        return res.redirect("/404.html");
      }
    })
  </code></pre>
  
  <p>And the code above is called before the</p>
  
  <pre><code>app.use(express.static("./public"));
  </code></pre>