POST requests in Project IDX (Express and Nodejs)

I’m currently building a Gemini web application using the online IDE Google IDX. However, when trying to send POST requests from the frontend(JS) to the backend(ExpressJS server), I keep getting this error:

has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'

I have tried setting permissions within the server file such as:

app.use(cors({
    origin: function (origin, callback) {
        callback(null, true);  
    },
    credentials: true
}));

Because there is no way that I know of to reference Project IDX frontend files like backend files.
The same error still occurs using this method and even when using ‘*’ to accept all origins.
If anybody has any knowledge about how I could bypass this issue it would be greatly appreciated.