diff --git a/expo-module.config.json b/expo-module.config.json new file mode 100644 index 0000000..8b7967e --- /dev/null +++ b/expo-module.config.json @@ -0,0 +1,6 @@ +{ + "platforms": ["devtools"], + "devtools": { + "webpageRoot": "static" + } +} diff --git a/package.json b/package.json index 12ee9ee..3f56c86 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "cli.d.ts", "metro.js", "metro.d.ts", + "static", "webui/dist" ], "homepage": "https://github.com/expo/expo-atlas", diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..3f64400 --- /dev/null +++ b/static/index.html @@ -0,0 +1,56 @@ + + + + + + + Expo Atlas - Redirecting... + + + + + + +
+

Redirecting.

+

Opening Atlas for your project, click here if that doesn't happen automatically

+
+ + diff --git a/webui/src/app/--/bundles/[bundle]/reload+api.ts b/webui/src/app/--/bundles/[bundle]/reload+api.ts index 481e4a9..b9afb67 100644 --- a/webui/src/app/--/bundles/[bundle]/reload+api.ts +++ b/webui/src/app/--/bundles/[bundle]/reload+api.ts @@ -14,7 +14,11 @@ export async function GET(_request: Request, params: Record<'bundle', string>) { ); } - return Response.redirect(bundle.serializeOptions.sourceUrl, 302); + // Convert the source URL to localhost, avoiding "unauthorized requests" in Metro + const sourceUrl = new URL(bundle.serializeOptions.sourceUrl); + sourceUrl.hostname = 'localhost'; + + return Response.redirect(sourceUrl, 302); } catch (error: any) { return Response.json({ error: error.message }, { status: 406 }); }