I made React, but I can't connect to the outside.

Asked 2 years ago, Updated 2 years ago, 154 views

I didn't install webpack, I made it with Create-React-App,

I've linked it to Express.

After running both React (Cla), Express (Server),

I can't connect to the outside (accessed from mobile LTE or external PC).

It says [Invalid Host Header].

The port was 3000, and we had a firewall open... It's open.

... why not?

When I searched on Google, there was an error even when I tried to use a proxy using a webpack.

I'm curious if anyone knows!

Do I have to distribute the reaction after building?

Currently, I only checked the operation using npm start, and it connects well to localhost:3000.

(proxy : {{web address}:50000} with proxy connected to port 50000)

react

2022-09-22 18:10

2 Answers

React is just a shell. If you want to access any web app on the LTE network, whether it is made with React or feet, you should distribute the application to the public web server .

In a practical sense, a web server is...

I don't think you can understand, but it would be faster if you just do it. Looking at it roughly, How to upload it directly to Heroku seems to be the fastest and most convenient. This is thought to be a way to push all the code to the Heroku dedicated code store, then download the code to a specific folder of heroku's virtual machine, and run the MEAN stack web server. Give that a try.

PS. Do I have to build? Probably


2022-09-22 18:10

Why don't you try ngrock?


2022-09-22 18:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.