Skip to content

Commit 67a77b9

Browse files
committed
灰度代码
1 parent c5bf00b commit 67a77b9

29 files changed

+18283
-406
lines changed

package-lock.json

Lines changed: 17951 additions & 406 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-blog-admin/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>sunq's blog admin</title><link rel=icon href=static/favicon.ico><link href=./static/css/app.1dc1d5a72ae9b593969432fac89a009e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.4e21b25fdbfb0330b6d5.js></script><script type=text/javascript src=./static/js/app.ddd3cb9f635fc6fea998.js></script></body></html>

test-blog-admin/serve.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//引入express中间件
2+
var express = require('express');
3+
var compression = require('compression');
4+
let axios = require('axios');
5+
const http = require('http');
6+
var bodyParser = require("body-parser");
7+
8+
var app = express();
9+
app.use(compression()); // 识别压缩后的文件,提高初始化速度
10+
app.use(bodyParser.json());
11+
12+
http.createServer(app).listen(68);
13+
14+
app.get('/', (req, res) => {
15+
res.sendFile('index.html', {root: __dirname});
16+
});
17+
18+
app.get('/*', (req, res) => {
19+
res.sendFile(req.params[0], {root: __dirname});
20+
});
21+
22+
app.post('/*', (req, res) => {
23+
let pathName = req.params[0],
24+
paramType = pathName.split('/')[0],
25+
url = '';
26+
27+
if(paramType == 'api'){
28+
url = 'http://39.104.22.73:8088' + pathName.replace('api','')
29+
}else if(paramType == 'snake'){
30+
url = 'http://39.104.22.73:8081' + pathName.replace('snake','')
31+
}else{
32+
url = 'http://39.104.22.73:8088' + pathName.replace('api','')
33+
}
34+
35+
axios.post(
36+
url,
37+
req.body
38+
).then(function (response) {
39+
res.end(JSON.stringify(response.data));
40+
}).catch(function (e) {
41+
console.log('ajax error');
42+
});
43+
});
107 KB
Loading
50.9 KB
Loading
75.1 KB
Loading
74.3 KB
Loading
2.62 KB
Loading
835 KB
Loading

test-blog-admin/static/css/app.1dc1d5a72ae9b593969432fac89a009e.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)