Another colab fix

This commit is contained in:
SillyLossy
2023-04-06 00:20:47 +03:00
parent 024c2f73de
commit 0c55bc6a09

View File

@@ -168,9 +168,11 @@ app.use((req, res, next) => {
if (req.url.startsWith('/characters/') && is_colab && process.env.googledrive == 2) { if (req.url.startsWith('/characters/') && is_colab && process.env.googledrive == 2) {
const filePath = path.join(__dirname, charactersPath, decodeURIComponent(req.url.substr('/characters'.length))); const filePath = path.join(__dirname, charactersPath, decodeURIComponent(req.url.substr('/characters'.length)));
console.log('req.url: ' + req.url);
console.log(filePath);
fs.access(filePath, fs.constants.R_OK, (err) => { fs.access(filePath, fs.constants.R_OK, (err) => {
if (!err) { if (!err) {
res.sendFile(filePath); res.sendFile(filePath, { root: __dirname });
} else { } else {
res.send('Character not found: ' + filePath); res.send('Character not found: ' + filePath);
//next(); //next();