Q:

Getting empty array from get

When i'm going to localhost:3000/api/categories i'm getting an empty array, but when i log my products there is alot of data inside the object.  Anyone knows what i'm doing wrong?  Thanks! 
let products = getData()

function getData() {
return fetch('some url',
    {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json'
        }
    }
).then(res => res.json())
};

app.get(('/api/categories'), (req, res) => {
    products.then(console.log);
    res.send(products);
    products.then(console.log);
});

A:

products is a promise.  You can't send it to the client via res.send. 
Instead, do what you're doing when you log it: use then:
app.get(('/api/categories'), (req, res) => {
    products
    .then(data => res.send(data))
    .catch(error => {
        // Send an error
    });
});

Note that your code gets the products once, at startup, and then responds to the request with that static set of products. 
If you want to get the products in response to the request from the client, remove the
let products = getData();

and put it in the get handler:
app.get(('/api/categories'), (req, res) => {
    this.getData()
    .then(data => res.send(data))
    .catch(error => {
        // Send an error
    });
});

That repeats the request each time the client calls your server. 
Of course, you might consider a middle ground, keeping and reusing the data for X seconds...

