nitrostack 1.0.48 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/studio/middleware.ts
CHANGED
|
@@ -8,12 +8,13 @@ export function middleware(request: NextRequest) {
|
|
|
8
8
|
// In development, proxy widget requests to the widget dev server
|
|
9
9
|
if (process.env.NODE_ENV === 'development' && process.env.WIDGETS_DEV_MODE === 'true') {
|
|
10
10
|
const widgetsDevPort = process.env.WIDGETS_DEV_PORT || '3001';
|
|
11
|
+
console.log(`[Middleware] Proxying widgets to port ${widgetsDevPort}`);
|
|
11
12
|
|
|
12
13
|
// Proxy /widgets/* to widget dev server
|
|
13
14
|
if (pathname.startsWith('/widgets/')) {
|
|
14
15
|
const widgetPath = pathname.replace('/widgets/', '');
|
|
15
16
|
const targetUrl = `http://localhost:${widgetsDevPort}/${widgetPath}`;
|
|
16
|
-
|
|
17
|
+
|
|
17
18
|
return NextResponse.rewrite(new URL(targetUrl));
|
|
18
19
|
}
|
|
19
20
|
}
|