How to return react app in Strapi

System Information
  • Strapi Version: 3.6.3
  • Operating System: Ubuntu 20
  • Database: local (sqlite)
  • Node Version: 14.17.1
  • NPM Version: 6.14.13

Hello Community,
I’ve got stuck with the passing HTML in response.

I have totally 3 apps.

  1. Strapi - https://my-api.com
  2. React App - https://my-react-app.com
  3. Third-Party app - https://other-app.com

GET https://my-api.com/api/get-form
The above URL request is sent by the Third Party app to my strapi server and I have to return an html.

/api/*/controller/fileName.js

const { data } = await axios.get('https://my-react-app.com/form-page');
ctx.send(data);

I have done this above method and it got worked out but it is not rendering Html in the UI.
If you notice from the screenshot, the <div id="main"></div> is empty.
Screenshot from 2021-07-08 09-43-19.

Can you please help me to find a solution…

@DMehaffy

if you didn’t understand anything from the question please ask me.

Thank you.

We don’t directly support returning HTML (It’s possible, but it’s not really a “supported” way to use Strapi)

We expect that all interaction with Strapi is handled over REST or GraphQL in the form of JSON or form-data for file uploads. Strapi is headless meaning it’s not designed to return raw HTML (with the exception of the Admin panel).