This is probably going to be an easy one but I am hitting a wall. What I am hitting to do is hit an endpoint using a GET Request and then pretty print that data to the console. Originally I was thinking I should be using app.get('/'); as this is how I did the Hello World and also the same when I build out a simple endpoint 'api/contacts'. My overall goal is just to GET the data from this endpoint and then use it for a post request. But now I believe I should be using app.use instead.
'use strict';
const access_token = "";
const express = require('express');
var bodyParser = require('body-parser')
const app = express();
app.use(bodyParser.json());
app.use('https://api.hubapi.com/content/api/v2/blog-posts?
limit=1000&hapikey=' + access_token, (req, res) => {
});
Now my thinking from Node I feel like I should be able to use the below. Also I feel like I should also be using res.send and this is not working.
console.log('STATUS: ' + response.statusCode);
console.log('HEADERS: ' + JSON.stringify(response.headers));