first commit
This commit is contained in:
1
Website/.pydio
Normal file
1
Website/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
24dfac02-a64a-48e6-8c32-8ac78b05ed5a
|
||||
28
Website/index.js
Normal file
28
Website/index.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const path = require("path");
|
||||
let package = require('./package.json');
|
||||
|
||||
app.use(express.static(path.join(__dirname, 'static')));
|
||||
|
||||
app.get('/checkUpload', (req, res) => {
|
||||
let updateVersion = package.updateVersion;
|
||||
let status = null;
|
||||
updateVersion.forEach((val,index) => {
|
||||
if(val.version == req.query.v) {
|
||||
if(index == updateVersion.length -1) {
|
||||
status = {
|
||||
code: 200,
|
||||
result: "当前已是最新版本"
|
||||
}
|
||||
} else {
|
||||
status = updateVersion[updateVersion.length-1]
|
||||
}
|
||||
}
|
||||
});
|
||||
res.json(status)
|
||||
});
|
||||
|
||||
app.listen(9000, () => {
|
||||
console.log('Example app listening on port 9000!')
|
||||
});
|
||||
30
Website/package.json
Normal file
30
Website/package.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"updateVersion": [
|
||||
{
|
||||
"id": 1,
|
||||
"version": "1.0.0",
|
||||
"downUrl": "http://127.0.0.1:9000/PugToHtml-1.0.3-mac.zip",
|
||||
"introduce": [
|
||||
{ "id": 1, "text": "项目第一次上传" },
|
||||
{ "id": 2, "text": "实现核心功能" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"version": "1.0.3",
|
||||
"downUrl": "http://127.0.0.1:9000/PugToHtml-1.0.3-mac.zip",
|
||||
"introduce": [
|
||||
{ "id": 1, "text": "实现开机自启" },
|
||||
{ "id": 2, "text": "实现主题切换" },
|
||||
{ "id": 3, "text": "实现检查更新功能" },
|
||||
{ "id": 4, "text": "实现启动欢迎页面" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"express": "^4.17.1"
|
||||
}
|
||||
}
|
||||
1
Website/static/.pydio
Normal file
1
Website/static/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
2a836718-5e5b-487c-80bd-1e774ad236d8
|
||||
Reference in New Issue
Block a user