瀏覽代碼

'添加后端代码'

master
刘冬煜 3 年之前
父節點
當前提交
d1c93ce2a2
共有 9 個檔案被更改,包括 28 行新增0 行删除
  1. 二進制
      style-transform-master/.vs/style-transform-master/v16/.suo
  2. 二進制
      style-transform-master/.vs/style-transform-master/v16/Browse.VC.db
  3. 二進制
      style-transform-master/style-transform-master/bin/Microsoft.NodejsTools.WebRole.dll
  4. +1
    -0
      style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.CoreCompileInputs.cache
  5. +3
    -0
      style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.FileListAbsolute.txt
  6. 二進制
      style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache
  7. +12
    -0
      style-transform-master/style-transform-master/public/js/getImage.js
  8. 二進制
      style-transform-master/style-transform-master/public/tmp/16.jpg
  9. +12
    -0
      style-transform-master/style-transform-master/server.js

二進制
style-transform-master/.vs/style-transform-master/v16/.suo 查看文件


二進制
style-transform-master/.vs/style-transform-master/v16/Browse.VC.db 查看文件


二進制
style-transform-master/style-transform-master/bin/Microsoft.NodejsTools.WebRole.dll 查看文件


+ 1
- 0
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.CoreCompileInputs.cache 查看文件

@ -0,0 +1 @@
a006da68cee2e5948f791e89043c9fd33dcfa03a

+ 3
- 0
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.FileListAbsolute.txt 查看文件

@ -0,0 +1,3 @@
C:\作业\云计算\大作业\style-transform-master\style-transform-master\style-transform-master\obj\Debug\style-transform-master.njsprojAssemblyReference.cache
C:\作业\云计算\大作业\style-transform-master\style-transform-master\style-transform-master\obj\Debug\style-transform-master.njsproj.CoreCompileInputs.cache
C:\作业\云计算\大作业\style-transform-master\style-transform-master\style-transform-master\bin\Microsoft.NodejsTools.WebRole.dll

二進制
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache 查看文件


+ 12
- 0
style-transform-master/style-transform-master/public/js/getImage.js 查看文件

@ -0,0 +1,12 @@
var xmlhttp = new XMLHttpRequest();
function detectImage(taskID) {
xmlhttp.open("GET","tmp\\"+taskID+".jpg",false);
xmlhttp.send();
if(xmlhttp.readyState == 4) {
if(xmlhttp.status == 200) {
location.replace("./success?taskID=" + taskID);
}
}
}

二進制
style-transform-master/style-transform-master/public/tmp/16.jpg 查看文件

Before After
Width: 512  |  Height: 512  |  Size: 8.1 KiB

+ 12
- 0
style-transform-master/style-transform-master/server.js 查看文件

@ -14,7 +14,19 @@ server.use(cookieParser());
const port = process.env.PORT || 1337;
server.get('/', function (req, res) {
});
server.post('/generate', function (req, res) {
let taskID = Date.now.toString(16);
res.cookie("taskID", taskID, {maxAge: 900000, httpOnly: true});
res.end('<script src="./js/getImage.js"></script><script>setInterval(function() {detectImage("16");}, 5000);</script>');
});
server.get('/success', function (req, res) {
let taskID = req.query.taskID;
res.end();
});
server.listen(port);

Loading…
取消
儲存