Spaces:
Sleeping
Sleeping
Update server.js
Browse files
server.js
CHANGED
|
@@ -6,9 +6,6 @@ const stream = require('puppeteer-stream');
|
|
| 6 |
const WebSocket = require('ws');
|
| 7 |
const http = require('http');
|
| 8 |
|
| 9 |
-
const server = http.createServer(app);
|
| 10 |
-
const wss = new WebSocket.Server({ server });
|
| 11 |
-
|
| 12 |
const app = express();
|
| 13 |
const PORT = 7860;
|
| 14 |
|
|
@@ -16,6 +13,9 @@ const PORT = 7860;
|
|
| 16 |
app.use(express.json({ limit: '40mb' }));
|
| 17 |
app.use(express.static('.'));
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
// CORS支持
|
| 20 |
app.use((req, res, next) => {
|
| 21 |
res.header('Access-Control-Allow-Origin', '*');
|
|
|
|
| 6 |
const WebSocket = require('ws');
|
| 7 |
const http = require('http');
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
const app = express();
|
| 10 |
const PORT = 7860;
|
| 11 |
|
|
|
|
| 13 |
app.use(express.json({ limit: '40mb' }));
|
| 14 |
app.use(express.static('.'));
|
| 15 |
|
| 16 |
+
const server = http.createServer(app);
|
| 17 |
+
const wss = new WebSocket.Server({ server });
|
| 18 |
+
|
| 19 |
// CORS支持
|
| 20 |
app.use((req, res, next) => {
|
| 21 |
res.header('Access-Control-Allow-Origin', '*');
|