feat(core): nwjs下添加对 手动更新 的支持

This commit is contained in:
王立帮
2025-09-29 20:10:01 +08:00
parent 753447359e
commit 5aed339f52
10 changed files with 367 additions and 52 deletions

View File

@@ -1,12 +1,14 @@
const http = require('http');
const express = require('express');
const path = require('path');
const apiRoutes = require('./api.js');
const StaticServer = {};
StaticServer.run = (port) => {
const app = express();
app.use(express.static(path.resolve(__dirname, '../')));
app.use('/api/', apiRoutes);
const httpServer = http.createServer(app);
httpServer.listen(port);
console.log('Static服务器正在运行 [端口 - ' + port + ', http]...');