撤回按钮

This commit is contained in:
2025-10-22 11:51:32 +08:00
parent 081939df01
commit e29366525d
4 changed files with 99 additions and 8 deletions

16
build/preview-static.js Normal file
View File

@@ -0,0 +1,16 @@
const connect = require('connect');
const serveStatic = require('serve-static');
const chalk = require('chalk');
const path = require('path');
const port = process.env.PORT ? Number(process.env.PORT) : 9526;
const mountPath = '/srs'; // 与生产 publicPath 保持一致
const distDir = path.resolve(__dirname, '..', 'dist');
const app = connect();
app.use(mountPath, serveStatic(distDir, { index: ['index.html', '/'] }));
app.listen(port, () => {
const url = `http://localhost:${port}${mountPath}/`;
console.log(chalk.green(`> Static preview running at ${url}`));
});