codenvy icon indicating copy to clipboard operation
codenvy copied to clipboard

What url to use when create-react-app runs?

Open karlkras opened this issue 5 years ago • 3 comments

Created a node workspace and installed/generated/ran react project with create-react-app. On start it does the normal stuff:

Compiled successfully!

You can now view myreact-app in the browser.

  Local:            http://localhost:3000/
  On Your Network:  http://10.0.23.2:3000/

I'd just like to know what url I hit to preview this running app?

karlkras avatar Oct 04 '18 03:10 karlkras

There is a run button on the top (triangle like a play button), press it and in console you'll have something like this:

http://node16.codenvy.io:47612
Example app listening on port 3000!

Copy that link, exit run window (just close run terminal or press stop button on the left). That's it, run your react app and preview it using that link you copied before

Sairyss avatar Oct 12 '18 08:10 Sairyss

There is a run button on the top (triangle like a play button), press it and in console you'll have something like this: http://node16.codenvy.io:47612 Example app listening on port 3000! Copy that link, exit run window (just close run terminal or press stop button on the left). That's it, run your react app and preview it using that link you copied before<

I don't get this result but same as OP.

evg1n avatar Dec 16 '18 17:12 evg1n

You have to internally forward the ports. Go to command pallet on the left and create new custom command: cd ${current.project.path} && npm start

Then change the preview url to: http://${server.port.3000}

Now go to the workspace configuration and add new Server: Any Reference Name, Port: 3000, Protocol: http

Restart the workspace and then use the triangle run button and you should get the preview url something similar to this: http://node25.codenvy.io:57562/

djraval avatar Mar 29 '19 07:03 djraval