From 9b2994066649d07a18a9c796b3dcfb114fa710d8 Mon Sep 17 00:00:00 2001
From: Oliver Kieselbach
Date: Wed, 18 Feb 2026 16:06:29 +0100
Subject: [PATCH] optimized bootstrapper script download
---
.../app/api/download/bootstrapper/route.ts | 28 +++++++++++++++++++
.../autopilot-monitor-web/app/docs/page.tsx | 2 +-
2 files changed, 29 insertions(+), 1 deletion(-)
create mode 100644 src/Web/autopilot-monitor-web/app/api/download/bootstrapper/route.ts
diff --git a/src/Web/autopilot-monitor-web/app/api/download/bootstrapper/route.ts b/src/Web/autopilot-monitor-web/app/api/download/bootstrapper/route.ts
new file mode 100644
index 00000000..9e504bfa
--- /dev/null
+++ b/src/Web/autopilot-monitor-web/app/api/download/bootstrapper/route.ts
@@ -0,0 +1,28 @@
+const BOOTSTRAPPER_URL =
+ "https://autopilotmonitor.blob.core.windows.net/agent/Install-AutopilotMonitor.ps1";
+
+export const runtime = "nodejs";
+
+export async function GET() {
+ try {
+ const upstream = await fetch(BOOTSTRAPPER_URL, { cache: "no-store" });
+ if (!upstream.ok || !upstream.body) {
+ return Response.redirect(BOOTSTRAPPER_URL, 302);
+ }
+
+ const headers = new Headers();
+ headers.set("Content-Type", "application/octet-stream");
+ headers.set(
+ "Content-Disposition",
+ 'attachment; filename="Install-AutopilotMonitor.ps1"',
+ );
+ headers.set("Cache-Control", "public, max-age=300");
+
+ return new Response(upstream.body, {
+ status: 200,
+ headers,
+ });
+ } catch {
+ return Response.redirect(BOOTSTRAPPER_URL, 302);
+ }
+}
diff --git a/src/Web/autopilot-monitor-web/app/docs/page.tsx b/src/Web/autopilot-monitor-web/app/docs/page.tsx
index 8feb50cd..408458e4 100644
--- a/src/Web/autopilot-monitor-web/app/docs/page.tsx
+++ b/src/Web/autopilot-monitor-web/app/docs/page.tsx
@@ -211,7 +211,7 @@ function SectionAgentSetup() {
Download the PowerShell script that installs and configures the Autopilot Monitor agent: