Fixed other issues with server
This commit is contained in:
parent
4c4e187eac
commit
26f106c517
1 changed files with 2 additions and 2 deletions
4
index.js
Normal file → Executable file
4
index.js
Normal file → Executable file
|
@ -5,10 +5,10 @@ const fs = require('fs');
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.use('/', (req, res) => {
|
app.use('/', (req, res) => {
|
||||||
if(fs.existsSync(`./webpage${req.path}`)) {
|
if(fs.existsSync(`${__dirname}/webpage${req.path}`)) {
|
||||||
res.sendFile(`./webpage${req.path}`, {root: __dirname});
|
res.sendFile(`./webpage${req.path}`, {root: __dirname});
|
||||||
}
|
}
|
||||||
else if(fs.existsSync(`./webpage${req.path}.html`)) {
|
else if(fs.existsSync(`${__dirname}/webpage${req.path}.html`)) {
|
||||||
res.sendFile(`./webpage${req.path}.html`, {root: __dirname});
|
res.sendFile(`./webpage${req.path}.html`, {root: __dirname});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue