Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
SharePoint Online ReactJS Webpart CORS Struggle

I'm developing a small "webpart" add-in to be placed on one of our company sharepoint pages. I've seemingly gotten stuck in CORS hell and can't seem to figure out how to get my requests to work. Here is the breakdown:

I have a VPS that hosts a website (NGINX that reverse proxys an ExpressJS server). This server also runs a few endpoints that interact with a 3rd-party API. The website hosted on the VPS is able to interact with this API without issue.

I was requested to migrate a small part of this website to our sharepoint page. Despite all my efforts, I continue to be struck by the Cross-Origin Resource Sharing error: PreflightMissingAllowOriginHeader. In both locations (NGINX and ExpressJS), I have added the necessary headers, but my sharepoint request is showing this with the previously mentioned CORS error:

cors1

NGINX config:

add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Content-Type';
proxy_pass http://localhost:5007;

ExpressJS uses the NPM CORS package:

const app = express()
app.use(cors())

If I navigate directly to the hosted website, I can see the headers are set:

enter image description here

Does anyone have any ideas as to why I cannot seem to get any requests from our sharepoint site to this hosted API?

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda