tmui-cli 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/net.js +9 -9
- package/package.json +1 -1
package/bin/net.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
const Open = import("open")
|
|
2
|
-
const
|
|
2
|
+
const bodyParser = require("body-parser")
|
|
3
3
|
const Fetch = import("node-fetch")
|
|
4
4
|
const express = require("express")
|
|
5
5
|
|
|
6
6
|
const app = express();
|
|
7
|
-
|
|
7
|
+
var jsonParser = bodyParser.json()
|
|
8
|
+
var urlencodedParser = bodyParser.urlencoded({ extended: false })
|
|
9
|
+
app.use(urlencodedParser)
|
|
10
|
+
app.use(jsonParser)
|
|
11
|
+
app.use(express.static('website'))
|
|
12
|
+
app.use('/store', express.static('websitemod'))
|
|
8
13
|
|
|
9
14
|
function setResHeader(res){
|
|
10
15
|
res.setHeader("Access-Control-Allow-Headers","*")
|
|
@@ -13,8 +18,7 @@ function setResHeader(res){
|
|
|
13
18
|
|
|
14
19
|
}
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
app.use('/store', express.static('websitemod'))
|
|
21
|
+
|
|
18
22
|
|
|
19
23
|
app.all("/api/dirlist",function (req,res){
|
|
20
24
|
setResHeader(res)
|
|
@@ -73,11 +77,7 @@ app.post("/api/checkUniappVer",async function (req,res){
|
|
|
73
77
|
|
|
74
78
|
|
|
75
79
|
async function createNet (){
|
|
76
|
-
|
|
77
|
-
var jsonParser = bodyParser.json()
|
|
78
|
-
var urlencodedParser = bodyParser.urlencoded({ extended: false })
|
|
79
|
-
app.use(urlencodedParser)
|
|
80
|
-
app.use(jsonParser)
|
|
80
|
+
|
|
81
81
|
|
|
82
82
|
app.listen(6170,async function (){
|
|
83
83
|
const open = (await Open).default;
|