I need to clarify that I'm still learning, and therefore I don't know if what I'm trying to do is good practice or not. To the point.
I'm building a website with React, using Node.js with express in the backend, that allows an admin to modify certain aspects of the website without messing with the code (I'm sure this has a name, but idk) the thing is, I'm sending "index.html" when the root path ("/") is accessed, I'm trying to use another, called "/admin", that when accessed, it will send another .html or something.
app.use(express.static(path.join(__dirname, 'build')));
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.get('/admin', function (req, res) {
res.sendFile(path.join(__dirname, 'build', 'admin.html'));
});
Implementing something along those lines has been a pain, I've tried using 2 separate index.html, using each one to link a different index.js file, I even using 2 different builds of the same project, all experiments resulting in missing styles, missing animations and a literal mountain of different errors, I'm sure this can be done in a really dumb way but I lack the terminology to make a proper Google search, thanks in advance.