Hello, I am new to plugin development and trying to setup locally. Apologies if this has been asked before (tried searching but can't find specific example) Initially I tried to fetch from ArgoCD API directly adding Bearer token to the fetch header. I got the horrible CORS error and now trying to create proxy entry.
In my app-config.yml I have the following:
proxy:
Example for how to add a proxy endpoint for the frontend.
A typical reason to do this is to handle HTTPS and CORS for internal services.
endpoints:
'/test':
target: 'https://example.com'
changeOrigin: true
'/argocd':
target: https://argocd.xyz.com/api/vi
headers:
Authorization: Bearer xxx
changeOrigin: true
secure: false
In the component I have the following:
const backendUrl = 'https://localhost:3000'
const request: RequestInfo = new Request(`${backendUrl}/api/proxy/applications/xyz/resource-tree`, {
method: 'GET',
})
return fetch(request)
// the JSON body is taken from the response
.then(res => res.json())
I am getting a net::ERR_SSL_PROTOCOL_ERROR.
Any help would be greatly appreciated. Thank you!