Skip to main content
Inspiring
November 10, 2020
Answered

Deliver HTML panel using NodeJS Express

  • November 10, 2020
  • 1 reply
  • 352 views

Hello all,

I do have an Adobe HTML Panel based on a ReactJS app which works great so far, but the biggest issue with this approach is that all requests are made using the `file://` origin causing more issues, like:

1. Not all APIs requests are accepted

2. AWS Cognito callback is not recognized

 

Is there a way that I can deliver my HTML Panel (ReactJS) through an Express Server (NodeJS) or any other specific server so I the end all of my requests will have the origin `http://localhost:PORT/` or maybe there is other `The Adobe Way` that I am missing?

Thank you in advance

This topic has been closed for replies.
Correct answer Justin Taylor-Hyper Brew

You have a few options:

  • Have a frontend and backend architecture. Essentially 2 panels, a headless backend running Express or something serving up the fronted, and a frontend pointed to the localhost port of the backend.
  • Allow "file://" protocol requests to your allowed options for your API key.
  • Have a separate process, Node.js / Python or whatever you like, and pipe requests through there.

 

Also if you're interested in building panels with React, check out the Bolt CEP boilerplate: https://github.com/hyperbrew/bolt-cep

1 reply

Justin Taylor-Hyper Brew
Community Expert
Community Expert
January 30, 2023

You have a few options:

  • Have a frontend and backend architecture. Essentially 2 panels, a headless backend running Express or something serving up the fronted, and a frontend pointed to the localhost port of the backend.
  • Allow "file://" protocol requests to your allowed options for your API key.
  • Have a separate process, Node.js / Python or whatever you like, and pipe requests through there.

 

Also if you're interested in building panels with React, check out the Bolt CEP boilerplate: https://github.com/hyperbrew/bolt-cep