fix: 后端添加express.static提供前端dist,9110端口可访问网页
This commit is contained in:
@@ -18,6 +18,9 @@ app.use(limiter);
|
|||||||
|
|
||||||
apiRoutes(app);
|
apiRoutes(app);
|
||||||
|
|
||||||
|
// 提供前端静态文件(Docker 镜像中 dist 位于 /app/dist)
|
||||||
|
app.use(express.static('dist'));
|
||||||
|
|
||||||
app.get('/api/health', async (_req, res) => {
|
app.get('/api/health', async (_req, res) => {
|
||||||
try {
|
try {
|
||||||
await pool.query('SELECT 1');
|
await pool.query('SELECT 1');
|
||||||
|
|||||||
Reference in New Issue
Block a user