test parse function

This commit is contained in:
Isman Usoh
2016-03-26 08:46:00 +07:00
parent ded7a3674f
commit 81b33d3367
@@ -20,3 +20,10 @@ app.get("/", function(req, res) {
res.end(userAgentString);
});
app.get("/parse", function(req, res) {
const source = req.headers['user-agent'],
const ua = useragent.parse(source);
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(JSON.stringify(ua));
});