res.sendFile() is not rendering in browser

I’ve been struggling with this for a few days. Anyone have any ideas? On click of a log in button I’m authorizing the user, generating a token, storing the token in cookies, then using the token in headers of a request to render to the homepage. I get no errors on the res.sendFile() and I’ve done some ordering with console.log() to make sure the order of events is proper. I can’t figure out what’s going wrong. Additionally, I know the res.sendFile works because in postman if I call the api route to take me to the homepage with the bearer token, the HTML is returned in the postman response. Below is the code – any help is appreciated!

index.js –>

document.getElementById('loginSubmit').addEventListener('click' , () => {
  var un = document.getElementById('username').value;
  var data = JSON.stringify({
    "username": un,
    "password": document.getElementById('password').value
  });
  document.cookie = 'user_name='+un;
  var req = new XMLHttpRequest();
  req.responseType = 'json'
  req.withCredentials = true;

  req.open("POST","~/users/authenticate", true);
  req.setRequestHeader("Content-Type", "application/json");
  req.send(data);
  
  req.addEventListener("readystatechange", function() {
    if(this.readyState === 4 && req.status == 200) {
          
    //save token to cookies
    var obj = req.response.token;
    document.cookie = 'user_token='+obj;
    console.log(document.cookie)

    //redirect home
    var req2 = new XMLHttpRequest();
    req2.open("GET","http://localhost:4000/homepage",true);
    req2.setRequestHeader("Authorization",'Bearer '+obj);
    req2.send(); 
    }
});

server.js –>

app.use('/users', require('./users/users.controller'));
app.use('/homepage', authorize(), (req,res) => {
    res.sendFile('/homepage.html', {root: publicDir}),function(err) { if (err) console.log(err);}
});

In postman, if I get ‘/homepage’ with the bearer token stored in the cookie and passed in the request header, I get the homepage.html as the response. But in browser, I get no error but also don’t get the ‘/hompage.html’ page. Everything else works as expected, user is authenticated, token generated, stored in cookie, etc. Verified the call is actually going through via console.log() and the request is correct.