mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-01 11:56:48 +01:00
Add CORS proxy placeholder
This commit is contained in:
parent
4f05d872f4
commit
bac43a2131
@ -343,6 +343,12 @@ if (getConfigValue('enableCorsProxy', false) === true || cliArguments.corsProxy
|
|||||||
res.status(500).send('Error occurred while trying to proxy to: ' + url + ' ' + error);
|
res.status(500).send('Error occurred while trying to proxy to: ' + url + ' ' + error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
app.use('/proxy/:url(*)', async (_, res) => {
|
||||||
|
const message = 'CORS proxy is disabled. Enable it in config.yaml or use the --corsProxy flag.';
|
||||||
|
console.log(message);
|
||||||
|
res.status(404).send(message);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
app.use(express.static(process.cwd() + "/public", {}));
|
app.use(express.static(process.cwd() + "/public", {}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user