I am using Lumen 7.7.2 for my api. I have enabled cors using this tutorial
https://github.com/digiaonline/lumen-cors,
but in my Ionic application the cors error disappears, however sometimes the api works well and returns the expected results and sometimes my ionic app returns this error "Failed to load resource: net::ERR_ADDRESS_UNREACHABLE". I tried connecting the ionic app to other lumen api's that I have on localhost and it works well with them all the time without any errors.
Is there a specific way am supposed to enable cors in lumen?