Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for other apps? #39

Open
tonymurray opened this issue Jun 27, 2022 · 5 comments
Open

API for other apps? #39

tonymurray opened this issue Jun 27, 2022 · 5 comments
Labels

Comments

@tonymurray
Copy link

Hello - would it be possible to use this app to provide API access to notes from (web)apps?.

Context: I am currently experimenting with Svelte / Node reading/writing notes. I have tried via the native Nextcloud WebDAV API. There are issues with CORS headers - I understand the native Nextcloud API was not designed for the 'front end', though it does works OK from a 'backend' node server.

@pbek pbek added the question label Jun 27, 2022
@pbek
Copy link
Owner

pbek commented Jun 27, 2022

It works perfectly fine to directly use webdav on the frontend. Key is authentication to the Nextcloud server.
I wrote https://apps.nextcloud.com/apps/webapppassword to generate temporary tokens for web-apps, there is a link to an example on the page.

@tonymurray
Copy link
Author

Thanks for the pointers. I am always still getting CORS issues in the browser context, but same code suceeds in the backend (i.e. node server). I added in the WebAppPassword 'Allowed origins' - though not working so far. I am using the following node library https://www.npmjs.com/package/webdav. Will try your example maybe next.

@pbek
Copy link
Owner

pbek commented Jul 4, 2022

Did you configure the origins, that should be able to access the nextcloud server?

@tonymurray
Copy link
Author

Hi - yes, - currently just development addresses: http://localhost:3000,http://localhost:3003

@pbek
Copy link
Owner

pbek commented Jul 5, 2022

You might have issues accessing https (your nextcloud server) from http.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants