Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 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.  
  11. var options = {
  12. "method": "GET",
  13. "hostname": [
  14. "{{accountName}}",
  15. "{{environment}}",
  16. "com",
  17. "br"
  18. ],
  19. "path": [
  20. "api",
  21. "catalog_system",
  22. "pvt",
  23. "category",
  24. "tree",
  25. "{{categoryLevels}}",
  26. ""
  27. ],
  28. "headers": {
  29. "content-type": "application/json",
  30. "x-vttt-api-appkey-api-appkey": "{{X-Vtt-API-AppKey}}",
  31. "x-vttt-api-apptoken": "{{X-Vtt-API-AppToken}}"
  32. }
  33. };
  34.  
  35. var req = http.request(options, function (res) {
  36. var chunks = [];
  37. res.on("data", function (chunk) {
  38. chunks.push(chunk);
  39. });
  40. res.on("end", function () {
  41. var body = Buffer.concat(chunks);
  42. console.log(body.toString());
  43. });
  44. });
  45. req.end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement