Created
January 16, 2017 10:42
-
-
Save conanak99/085a2613a43488957bd98149650e37aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Chạy hàm trong này khi có post request tới | |
app.post('/', (req, res) => { | |
let imageUrl = req.body.url; // Đọc trường url trong json gửi | |
// Gọi làm recognize | |
recognize(imageUrl).then(result => { | |
res.status(200).json(result); // Trả về kết quả dưới dạng json | |
}).catch(err => { | |
console.log(err); | |
res.status(500).json(err); | |
}); | |
}); | |
// Setup để kết nối giữa webtask và express | |
module.exports = fromExpress(app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment