Detaching React js project on Ubuntu - reactjs

I have created two React projects using React Js. The both of them are for different purposes. One is successfully running on 1.2.3.4:3000 here the port is default (3000) But I have another react project with port 4000. Now how can I run or deploy the second React js(client) on port 4000?
Folder structure
/
|-- adminReact (port 3000)
|
|--clientReact (port 4000)

Thankyou all
I managed this problem with the hekp of linux screen.
I created two screens with meaningful name. Then O run the react projects on different port.
screen -R adminReact
Then go inside the adminRea t directory then start the adminReact project. After successful running, I pressed ctrl + a + d to detach from the screen.
Then type exit will close the screen.
Then takea new putty session. After that create a new screen screen -R clientReact for the clien react projects.Then go inside the folder then start the project, after successful running press ctrl + a + d to detach the screen.
That's it

Related

Dockerized Create React App doesn't open a new tab

I noticed a strange behavior when running my app with Docker - it doesn't open a new tab.
If I run my app manually with npm/yarn start, tab opens fine.
I don't have "BROWSER=none" in .env
It's because the create-react-app start script tries to open the local browser. Here's one of the relevant parts of the start script:
/**
* Attempts to open the browser with a given URL.
*
* On Mac OS X, attempts to reuse an existing Chrome tab via AppleScript.
*
* Otherwise, falls back to [open](https://github.com/sindresorhus/open) behavior.
*/
declare function openBrowser(url: string): boolean;
export = openBrowser;
However, if your application is running in a docker container, it's like it is running on a separate machine, or VM. Which doesn't have a browser installed.
And the way Docker containers work, they can't just invoke programs of the host machine (without rather complex workarounds).

My webRTC APP doesn't work on Heroku (Using simple-peer and socket.io)

My webRTC app doesn't work on Heroku, but work on local environment.
My Heroku App: https://rgvc-client.herokuapp.com/
Github client: https://github.com/sayagit/RGVC-client
Github server: https://github.com/sayagit/RGVC-server
What I want to do:
If you enter this page, click 'Create Room' button, then your video and audio are played on the browser.
Then you copy address, open and paste the address on new browser, my app starts video chat between two browsers.
Problem:
My app can start one video, but can't start another one and any error doesn't occur.
client/.env(Heroku)
REACT_APP_API=https://rgvc-server.herokuapp.com/
server/.env(Heroku)
CLIENT_URL=https://rgvc-client.herokuapp.com/
I'm glad if you have any idea.

React URLs are not Accessible

hi i've run following command pm2 start process.json on ec2 AWS.
Here is my process.json file
{
"script": "serve",
"env": {
"PM2_SERVE_PATH": './build',
"PM2_SERVE_PORT": 5000
}
}
When I run the pm2 command shown above. I can access the Base URL. But when I type the Sub URLs from browser, it shows a page that contains 404 |The requested path cannot be found.
Below is my file structure
I am generating the project using npm run build then pm2 start process.json
So the app starts up and you can access the root page? What about your routes? Are they set up properly? Are you using react-routing or something else?
This sounds like a routing issue. Does it only happen on the AWS platform?
Hi I found a solution to this problem.
When I use serve on pm2 it shows 404 page whenever it didn't find a url resource. To resolve that I used screen on ec2.
To open a new screen type screen
Then in your react folder type command serve -s build -p 5000 Now you can detach your screen using CTRL + D

HTML/JS directory disappears on production server

So, I have a full-stack web application generated with JHipster, I have recently needed to change the name of one of the entities in the webapp area and the template/js files because it was clashing (had the term api in it)
Now it all works just fine in local, but when uploading the application to jenkins for production it just won't want to find the new files
I have tried:
Hard reload / Ctrl + Shift + Del / and opening in a different browser
Erasing the target folder.
Wiping the whole workspace from jenkins.
I created a new item in jenkins.
Changing the href manually in the developer tools
All unsuccesful and result in the same error message
The most annoying thing is that it works like a charm when deploying in local, with both dev and prod profiles.
This is the error message I get on the console, obviously it never reaches the back-end so remote debugging was useless for this:
GET [long url here]/app/entities/trade-drug-capi/trade-drug-capis.html?cacheBuster=1488389348167 404 (Not Found)

My images inside the images subfolder wont show in heroku but works ok in local

I have a Node.Js App using express and Angular. While developing and running a local server everything worked perfectly.
But once deployed in Heroku, images (vewed in the gallery page) inside sub folders (images/*) just wont load while in Heroku.
When I try to go directly to the image URL the ones directly in the images folder work well:
servicentrov2.herokuapp.com/images/Fondo1.jpg
But the ones in subfolders wont, and show part of the page:
servicentrov2.herokuapp.com/images/galerias/2014Hallel/2014-Hallel-01.jpg
I think it might be that:
1. the sub folders are not available in server
2. some routing problem
The code is in https://github.com/blogcraft/Servicentro2.0
The Heroku app is in https://servicentrov2.herokuapp.com
Any help will be appreciated :)
You have the text case wrong in the link:
servicentrov2.herokuapp.com/images/galerias/2014Hallel/2014-Hallel-01.jpg
should be:
servicentrov2.herokuapp.com/images/galerias/2014hallel/2014-Hallel-01.jpg
(Note: lowercase '2014hallel').
You should be able to login to your Heroku terminal via SSH. Poke around in there and see if the images are actually located where your app is looking for them as a first step.

Resources