codenvy
codenvy copied to clipboard
What url to use when create-react-app runs?
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?
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
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.
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/