Skip to content

Fix for root apps#2

Open
tim-webflow wants to merge 1 commit intoWebflow-Examples:mainfrom
tim-webflow:update-for-root-apps
Open

Fix for root apps#2
tim-webflow wants to merge 1 commit intoWebflow-Examples:mainfrom
tim-webflow:update-for-root-apps

Conversation

@tim-webflow
Copy link
Copy Markdown

@tim-webflow tim-webflow commented Apr 3, 2026

As it stands this app does not work when published to the root path. THis update makes it work whether it's published to a site (which requires a subpath) or as an independent Webflow Cloud project where it can be at a subpath like /app or the root path.

This works for me testing in my workspace but please check to make sure I'm using Astro and the environment variables that Webflow Cloud uses correctly.

@tim-webflow tim-webflow marked this pull request as draft April 3, 2026 18:19
@tim-webflow tim-webflow force-pushed the update-for-root-apps branch 8 times, most recently from b305093 to 7ee5aa6 Compare April 10, 2026 17:48
@tim-webflow tim-webflow marked this pull request as ready for review April 10, 2026 17:49
@tim-webflow tim-webflow force-pushed the update-for-root-apps branch from 7ee5aa6 to 506dfac Compare April 10, 2026 17:50
build: {
assetsPrefix: "/app",
},
base,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During the webflow cloud build process, we will overwrite base to be the value of your mount path found in the dashboard, so setting the base here doesn't really do anything.

try {
setLoading(true);
const response = await fetch(`${import.meta.env.BASE_URL}/api/list-assets`);
const response = await fetch(`${assetsPrefix}api/list-assets`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might want to use Astro's url constructor to generate the right urls instead of trying to build it yourself with BASE_URL and managing slashes.

https://docs.astro.build/en/reference/api-reference/#url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants