1

I want hit my api which is running on 3090 port so added proxy key in package.js like below

"proxy": {
    "/api/*": {
      "target": "http://localhost:3090"
    }
  } 

but i didn't worked why?

1 Answer 1

1

If you are using Webpack then try setting it in Webpack.config.js file

  devServer: {
       historyApiFallback:true,
       proxy:{
            "/api/*":"http://localhost:3090"
        }
   }
Sign up to request clarification or add additional context in comments.

11 Comments

What is the base path of your backend service?
i added in Webpack.config.js even though its not working
I am asking the base path. You will be setting it in index.js file like app.use(“/path”, routes) if your backend service is written in node js
const port = process.env.PORT || 3090; const server = http.createServer(app); server.listen(port);
Not that. Can you share one backend Api call URL
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.