Adonis.js, Ionic and Cors

I’m trying to get CORS working on my adonis.js backend, and ionic front end but I can’t get anything working for some reason.

I’ve added the cors provider to my app.js

const providers = [

loaded it in kernel.js

const serverMiddleware = [


and I’ve set my origin: true and no matter what I do, nothing seems to be fixing it. I’ve even done the following function with origin to try get it to log out the origin, and nothing is being logged out, so it makes me wonder if it’s even loading my cors.js config.

origin: function (currentOrigin) {;
    return currentOrigin === ''

Does anyone have any idea as to how to get it working? Many thanks in advance

Leave a Reply

Your email address will not be published. Required fields are marked *