|
@ -14,7 +14,19 @@ server.use(cookieParser()); |
|
|
const port = process.env.PORT || 1337; |
|
|
const port = process.env.PORT || 1337; |
|
|
|
|
|
|
|
|
server.get('/', function (req, res) { |
|
|
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); |
|
|
server.listen(port); |