Raz
Raz

Reputation: 1994

Node.js & express how to open my rest api on localhost to remote partners?

My partners can send http requests to my domain, like this:

https://www.example.com/getrequest/

As my domain is public. And I have also enabled CORS.

How to enable such a thing with my localhost during development?

I have tried to visit my Node.js server with my IP address in the url bar in the browser of a different device like this:

http://myip:8080

But it asks for the WiFi password. How make my IP available for incoming requests, just similar to my VPS so it will be available to development with partners?

Thanks.

Upvotes: 0

Views: 392

Answers (1)

Giannis Mp
Giannis Mp

Reputation: 1309

In order for your computer to be accessible from the internet you have to enable port forwarding for your router Port Forwarding

The thing is that your router has a unique IP address yet many devices connect to it so they all share the same IP. The router with port forwarding links a specific device to a specific port so that you can access your computer from http://ROUTERIPADDRESS:DEVICEPORT from the outside world.

Upvotes: 1

Related Questions