Skip to content

Commit

Permalink
Merge pull request #80 from grafana/malcolmholmes/additional-endpoints
Browse files Browse the repository at this point in the history
Add additional proxy endpoints
  • Loading branch information
malcolmholmes committed Feb 15, 2024
2 parents 138c6ea + 1275f45 commit a6afccd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to the "grafana-vscode" extension will be documented in this file.

## v0.0.16
- Add additional proxy endpoints (to support more dashboards/etc) (#80)

## v0.0.15
- Follow redirects and don't fail on trailing slashes (#77)
- Theming (light/dark) support for Grafana (#74)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "Grafana",
"description": "Grafana Editor",
"icon": "public/grafana_icon.png",
"version": "0.0.15",
"version": "0.0.16",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,18 @@ export async function startServer(secrets: vscode.SecretStorage, extensionPath:
"/public/*",
"/api/datasources/proxy/*",
"/api/datasources/*",
"/api/plugins/*",
];
for (const path of mustProxyGET) {
app.get(path, function (req, res) {
proxy.web(req, res, {});
});
}

const mustProxyPOST = ["/api/ds/query"];
const mustProxyPOST = [
"/api/ds/query",
"/api/datasources/proxy/*",
];
for (const path of mustProxyPOST) {
app.post(path, function (req, res) {
proxy.web(req, res, {});
Expand Down

0 comments on commit a6afccd

Please sign in to comment.