Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. app.get("/", function(req, res){
  2. res.render("secao/home");
  3. });
  4.  
  5. app.listen(3000, function(){
  6. console.log("Servidor rodando");
  7. });
  8.  
  9. var http = require("http");
  10. var options = {
  11. "method": "GET",
  12. "hostname": [
  13. "{{accountName}}",
  14. "{{environment}}",
  15. "com",
  16. "br"
  17. ],
  18. "path": [
  19. "api",
  20. "catalog_system",
  21. "pvt",
  22. "category",
  23. "{{categoryId}}"
  24. ],
  25. "headers": {
  26. "content-type": "application/json",
  27. "x-vttt-api-appkey": "{{X-VTTT-API-AppKey}}",
  28. "x-vttt-api-apptoken": "{{X-VTTT-API-AppToken}}"
  29. }
  30. };
  31.  
  32. var req = http.request(options, function (res) {
  33. var chunks = [];
  34.  
  35. res.on("data", function (chunk) {
  36. chunks.push(chunk);
  37. });
  38.  
  39. res.on("end", function () {
  40. var body = Buffer.concat(chunks);
  41. console.log(body.toString());
  42. });
  43. });
  44.  
  45. req.end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement