feat(core): nwjs下添加对 手动更新 的支持
This commit is contained in:
@@ -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]...');
|
||||
|
||||
Reference in New Issue
Block a user