luizribeiro / mariner

Web interface for controlling MSLA 3D Printers based on Chitu controllers, such as the ones by Elegoo and Phrozen.
MIT License
246 stars 65 forks source link

CORS Support for API #531

Open 503Dev opened 2 years ago

503Dev commented 2 years ago

Is your feature request related to a problem? Please describe. When attempting to access the api endpoints via http get with fetch or axios a CORS error is returned as it appears Flask CORS is not enabled.

Describe the solution you'd like Enable Flask CORS for the api endpoints.

Describe alternatives you've considered NA - From the client using the api provided by mariner there is no way to circumvent CORS.

Additional context I am running mariner3d on a local pi zero. I have my own dashboard to aggregate multiple printers and use axios to grab api endpoints. I can easily access the api endpoint server side but using a react app or a browser app I get a CORS error due to cross-origin header not being sent by server. I believe the fix is to use Flask CORS however I am not sure how to edit the live install of mariner3d. I know where to edit the source but not sure how to edit the live install.