How can I serve a .js file with nextcloud? [closed]

3 weeks ago 17
ARTICLE AD BOX

I have nextcloud locally installed as a docker image. One of the files in the nextcloud filemanager is a .js file. I want to import this file from a vue app that runs on localhost:5173. But this throws a CORS error in the browser.

I import the file like this in my app on localhost:

<script type="text/javascript" src="http://debiancloud:8090/f/524"></script>

I included this in the .htaccess file on nextcloud and restarted the container:

Access-Control-Allow-Origin: "http://localhost:5173" Access-Control-Allow-Methods: "GET, POST, OPTIONS" Access-Control-Allow-Headers: "Content-Type"

but the error is still coming up. Is it at all possible to serve .js from nextcloud?

Read Entire Article