Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get("/", function(req, res){
- res.render("secao/home");
- });
- app.listen(3000, function(){
- console.log("Servidor rodando");
- });
- var http = require("http");
- var options = {
- "method": "GET",
- "hostname": [
- "{{accountName}}",
- "{{environment}}",
- "com",
- "br"
- ],
- "path": [
- "api",
- "catalog_system",
- "pvt",
- "category",
- "tree",
- "{{categoryLevels}}",
- ""
- ],
- "headers": {
- "content-type": "application/json",
- "x-vttt-api-appkey-api-appkey": "{{X-Vtt-API-AppKey}}",
- "x-vttt-api-apptoken": "{{X-Vtt-API-AppToken}}"
- }
- };
- var req = http.request(options, function (res) {
- var chunks = [];
- res.on("data", function (chunk) {
- chunks.push(chunk);
- });
- res.on("end", function () {
- var body = Buffer.concat(chunks);
- console.log(body.toString());
- });
- });
- req.end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement