Share a File from nextcloud to my app website

Sorry: First time posting here. Hello There.
I want to access a File from my nextcloud to my website, (outside of nextcloud).
I was wondering if i could add a Volume on the docker file, as i do not know much.
Question 1: what path should i use to the docker file on volume e.x.

volumes:
      - nextcloud/what?:/var/www/html

I thought of trying webdav so that i could get the file via axios or fetch.
The url trying was: https://example.com/nextcloud/remote.php/dav/files/USERNAME/
Question 2: There i get response 301 moved permanently, what i am doing wrong?

Thanks, did not know what category to select, there were many.

What is your use case?

  1. You would like to access files from website via Nextcloud to be able to change them?
    Then add volume as you wish e.g.
volumes:
    # Format:
    # - /Local/Machine/folder:/container/folder
    - /var/www/html:/nextcloud/myWebSite

After this, via nextcloud Settings → External Storages add /nextcloud/myWebSite as external local storage and that’s it.

  1. You would like to save and manage files in Nextcloud and give an access to content (e.g. pictures) via links to your website?

For Webdav you need to have user/password, but you can simply share folder and then access files via link, e.g.:

Read a bit more about: Прямая ссылка на изображение в общей папке - #6 by gas85 or here: Access a shared folder with a bash script (davfs?) - #3 by gas85

I just wanted to access a file content from outside of nextcloud. From a website its content will be shown on a page. Thanks, i will give a look on your Answer and tell you.
Thanks

Than seems use case 2 is one right for you.

@Lejla94
I think if you want only access a few files you search the app Sharing Path (video).

For a lot of files nextcloud is not your solution.

Hello, i actually want to share a (one) file (even if it changes later) with my javascript (actually i am using vuejs) website.
So when i change the file the app will show the contents of the changed file.
I saw the video, but not sure how to connect the shared file (path) with my code.
I have never done something similar before sorry!

After public sharing and using sharing path you get a link (cut-and-paste) e.g.:

https://cloud.server.tld/apps/sharingpath/username/path/filename.pdf
or in subdir e.g.
https://www.server.tld/nextcloud/apps/sharingpath/username/path/filename.pdf

This is the URL of the file you can use in your other software.

On the same server (second example with subdir) you can e.g. use the relative url:
/nextcloud/apps/sharingpath/username/path/filename.pdf

Thanks i will try that.

The same is valid for simple sharing: