ENOENT: no such file or directory, stat ERROR with Express Middleware
<p>This seems to be a common error with file paths but my problem is a but more strange because code worked fine yesterday but not today (and I did not change any code). My folder directory is quite simple: </p>

<pre><code>-node_modules
-public
    -css
    -js
    control_panel.html
    index.html
app.js
packages.json
</code></pre>

<p><a href="https://i.stack.imgur.com/afcF4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/afcF4.png" alt="enter image description here"></a></p>

<p>and I am using an Express middleware inside app.js to help render files. </p>

<pre><code>var express = require("express");
var app = express();

app.use(express.static("public"));

app.get('/', function get(req, res) {
    res.sendFile('/index.html');
});

app.get('/control_panel', function get(req, res) {
    res.sendFile('/control_panel.html');
});
</code></pre>

<p>When I try to open index.html in the browser, there is no problem, everything works as expected. When I try to open control_panel.html in the browser, however, I get <code>Error: ENOENT: no such file or directory, stat '/control_panel.html' at Error (native)</code></p>

<p>What is causing the problem?</p>