Run a big app inside a small app

I have a small app that runs on a custom domain. At some point, I will want that small app to call a bigger app (potentially one of a number of bigger apps) and pass control over to that app completely, but I want the custom domain to stay the same (so I can’t just launch a new app in the tab, I don’t think).

The bigger app is self contained and doesn’t need anything from the smaller app apart from some data that can be passed through a shared data table, and of course to keep the original custom domain.

The bigger apps are developed quite separately and are capable of being run on their own, without being launched in this way.

Can this be done? Am I making any kind of sense?

I think the simplest way to do this could be an iframe?

As both apps are anvil apps, I’m not sure how that would that work?

Why not?

You can create a Custom HTML form in the small app. Then, you can paste the iframe code of big app inside the custom html form.

1 Like

On the ‘big’ app, you could create an endpoint that returns a redirect response and then hit that endpoint from the ‘small’ app.

Trying that now …

Sorry, I’m having a slow day. I don’t quite understand that …

ohhhhhh, I see. Looks clever - trying that now …

EDIT - Christ, I think I’m getting thicker. I actually used that technique before (though it doesn’t seem to work for this situation) :

OK, if I hit the big app’s endpoint from a browser, it redirects me to the big app proper, but if I send the request from the small app, I just get the big app returned (I can print it with response.get_bytes())

How do I get the small anvil app to actually “run” big app? (“run” in quotes because I’m just testing just with the wikipedia page as in the example at the moment, so as not to have to many variables).

EDIT - I can obviously set the window in JS to the new location, but that won’t help - the URL will change and I need it to stay as small-app’s url.

Can’t get my head around this - gonna try the iframe idea.

Ah. I hadn’t realised that bit.

That seems to work, thanks. I appear to have forgotten more than I remember …

1 Like