title: ExpressJS sendFile() cannot send URL GET parameters
body: <p>I'm new to Node.js and Express.js and its routing. It's all set up correctly and it all works except for the following code.</p>
  
  <p>I tried the following code:</p>
  
  <pre><code>app.get("/game/*", function(req, res) {
    res.sendFile(__dirname + "/public/game.html?gameId=" + /\/([^\/]+$)/.exec(req.url)[1]);
  });
  </code></pre>
  
  <p>The goal was to send all requests with <code>/game/{gameId}</code> (where <code>gameId</code> is some number) to <code>/public/game.html?gameId={gameId}</code>.</p>
  
  <p>It correctly gets the requests with <code>/game/</code>, gets the <code>gameId</code> parameter from the URL, and attempts to <code>sendFile()</code> it. However, the <code>sendFile()</code> does not work, saying:</p>
  
  <blockquote>
    <p>web.1  | Error: ENOENT, stat '/opt/lampp/htdocs/papei/public/game/32'</p>
  </blockquote>
  
  <p>I've searched this error, and I guess it has to do with a file not being found. The problem is, <code>/public/game.html</code> exists. If I remove the <code>?gameId...</code> part in the <code>sendFile()</code>, then it works. But I guess the <code>sendFile()</code> is looking for an <em>exact</em> URL, and is not finding it.</p>
  
  <p>Is there any way to send URL GET parameters using ExpressJS?</p>