mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-28 02:45:08 +08:00
Merge 4926f6f625 into 2f7b6e3a65
This commit is contained in:
commit
713003e072
|
|
@ -153,7 +153,11 @@ export default ({ app }: { app: Application }) => {
|
||||||
app.use(rewrite('/open/*', '/api/$1'));
|
app.use(rewrite('/open/*', '/api/$1'));
|
||||||
app.use(config.api.prefix, routes());
|
app.use(config.api.prefix, routes());
|
||||||
|
|
||||||
app.get('*', (_, res, next) => {
|
app.get('*', (req, res, next) => {
|
||||||
|
// Don't serve index.html for API routes
|
||||||
|
if (req.path.startsWith('/api/')) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
const indexPath = path.join(frontendPath, 'index.html');
|
const indexPath = path.join(frontendPath, 'index.html');
|
||||||
res.sendFile(indexPath, (err) => {
|
res.sendFile(indexPath, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user