I am calling a local API from ionic project testing on android but it shows Http response status code 0 unknown error I did look up for many solutions but non helped.
app.use(function(req, res, next) {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, OPTIONS');
    res.header("Access-Control-Allow-Credentials", "true",);
    res.header('Access-Control-Allow-Headers', 'Origin, X-Auth-Token, Accept, Content-Type, Authorization, Content-Length, X-Requested-With, x-access-token, Access-Control-Request-Method, Access-Control-Request-Headers');
  next();
});
method requesting API.
    async loginWithFacebook(data) {
        console.log("api USER data from facebook ");
        console.log(data);
        let headers = new HttpHeaders({
            'Content-Type': 'application/json'
        });
        let options = {
            headers: headers
        };
        return await (this.http.post(environment.endpoint + "/users/facebook-login", data, options)).toPromise();
    }
it's unable to call the API for some reason.


 
    