Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Aurelia AdminPanel served inside Express-App - Cors Error on Droplet?
Jolly good day guys!
I’m trying to get a Project to work that contains of 1.) An Express application that Serves all FIles to the visitor, and 2.) An Aurelia Admin-Panel that allows changes to the database over api/fetch-calls to the express application.
The Aurelia-Adminpanel is serverd via the public/static files of the express-application.
On my Local Machine this combination works great, cause this way there are no cors-problems, since the Admin-App is serverd over the express-app.
On my dropled i get an error though:
“Fetch API cannot load http://localhost:3030/casino. Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ’http://126.96.36.199:3030’ is therefore not allowed access.”
Which looks like a cors problem, right? Thats the exact same error I get when I start the adminpanel-index not over my express app via routes, but execute it directly from my finder.
The Aurelia/Admin pannel is requesting “http://localhost:3030/**path**”
Is there anything I’m missing out? Is there a way to get the desired behaviour?
Thanks a lot!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×