Bladeren bron

'添加后端代码'

master
刘冬煜 3 jaren geleden
bovenliggende
commit
d1c93ce2a2
9 gewijzigde bestanden met toevoegingen van 28 en 0 verwijderingen
  1. BIN
      style-transform-master/.vs/style-transform-master/v16/.suo
  2. BIN
      style-transform-master/.vs/style-transform-master/v16/Browse.VC.db
  3. BIN
      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. BIN
      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. BIN
      style-transform-master/style-transform-master/public/tmp/16.jpg
  9. +12
    -0
      style-transform-master/style-transform-master/server.js

BIN
style-transform-master/.vs/style-transform-master/v16/.suo Bestand weergeven


BIN
style-transform-master/.vs/style-transform-master/v16/Browse.VC.db Bestand weergeven


BIN
style-transform-master/style-transform-master/bin/Microsoft.NodejsTools.WebRole.dll Bestand weergeven


+ 1
- 0
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.CoreCompileInputs.cache Bestand weergeven

@ -0,0 +1 @@
a006da68cee2e5948f791e89043c9fd33dcfa03a

+ 3
- 0
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsproj.FileListAbsolute.txt Bestand weergeven

@ -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

BIN
style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache Bestand weergeven


+ 12
- 0
style-transform-master/style-transform-master/public/js/getImage.js Bestand weergeven

@ -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);
}
}
}

BIN
style-transform-master/style-transform-master/public/tmp/16.jpg Bestand weergeven

Voor Na
Breedte: 512  |  Hoogte: 512  |  Grootte: 8.1 KiB

+ 12
- 0
style-transform-master/style-transform-master/server.js Bestand weergeven

@ -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);

Laden…
Annuleren
Opslaan