Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
API returns index.html instead of result when deployed to Prod (Proxy issue?)

So I'm building a react webapp that calls some methods deployed on a server.

I installed http-proxy-middleware and added the follow under src folder: setupProxy.js

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
  app.use(
    '/api',
    createProxyMiddleware({
      target: process.env.API_URL,
      changeOrigin: true,
      pathRewrite: { '^/api': '' }
    })
  );
};

However, things seem to be working fine locally but when I deploy, the APIs seem to return the html page. Moreover, if I add a <noscript> tag, I get the noscript value within the API preview.

I tried few solutions online but it seems I can't really detect what I'm missing.

Any help would be appreicated

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!