How to run a webapp in browser using localhost? - javascript

I have a program in node.js. I ran the code using "node main.js". It starts listening. When I try to open the link, "https://localhost:8080" it displays, "It works !
If you're seeing this page via a web browser,"
which is usually popped up after tomcat installation. how can i fix it and run my code?

You probably have a tomcat server running on the same port. Shut it down and run the node.js server only

Related

Internal Server error using Bash Terminal, any idea why is it throwing this error and how to fix it?

I have just recently started learning about APIs as party of Full stack developer course. Everything has been working fine until I have activated system storage sense in Windows to clear some space in the disk /c, the curl command stopped working and is giving internal server error.
curl calling request error using bash terminal
I have realized there is an issue when I have run my code and it stopped pulling information from the API link.
Since you made a windows change my guess would be - try addding the curl folder path to your Windows PATH environment variable so that the curl command is available from any location at the command prompt.

Meteor server crashes very frequently without any error

I am working with the Meteor application and I deployed the same over EC2 instance. It was working fine till a few days back.
But now the server process kill automatically without any error log or
console
I tried to get the error but unfortunately, as there are not any logs I am unable to find out why the server is crashing again and again.
I have a medium EC2 machine on which the application is running.
I am using nohup for running the application in the background.
Below is the command I used to start the server:-
nohup meteor --settings SETTINGS-PRODUCTION.JSON &
I am wondering to know about server crashes due to nohup or some other reason is there.
Please let me know how we can console uncaught exception in the meteor-like we do in express.
What should I use to auto restart the server if the process is killed
by any error or exception?
Any help would be much appreciated!
Thanks
Using nohup is quite a low-tech solution. Things like Phusion Passenger, PM2, or forever do a better job.
Also your docker container can be configured to automatically restart the process.
Even better is a tool called Meteor Up, which makes it really simple to deploy Meteor apps to EC2.
EASILY DEPLOY YOUR APP Meteor Up is a production quality Meteor app
deployment tool.
Install with one command:
$ npm install --global mup
http://meteor-up.com/

Local http server has stopped running

I installed the NPM package and the http server in the "server" folder. Everything worked perfectly, but then suddenly the server stopped running.
When I try to start the local http server I see this error message in the terminal (console)
You probably have anlther application running on port 8080. Try navigating to localhost:8080 to figure out what it is and close the application.
It could even be another instance of node.

PhantomJS connects to URL but CasperJS times out

Trying to write some tests with casperjs but the server I'm trying to connect connects fine using phantomjs, but gets hung up using casperjs any time it tries to make a connection to this app:
casper.start(MYURL) or casper.open(MYURL)
Casper works with other URLs, I'm just wondering is there anything that could be preventing casper from connecting to an app? (Note: when the app is not running on the server, casper could get to it and get the 502 Bad Gateway error at least. When the app's running, the script just seems to get stuck on the above code)
Also the app is running https so I'm using the flag --ignore-ssl-errors=true when running both scripts.
Just really confused since PhantomJS works perfectly fine.

How to use a browser on a remote server for an automated tests

I inherited a project where the person wrote tools to test our site's UI using JQuery and JS.
I don't know too much about it other than it requires a browser to be spawned and I think the tool uses JS to interact with iframes to see if it's the expected values.
My job is to get this tool to run on a remote server and post the results to Jenkins.
The remote test server and staging server is linux. From our staging server, I want to write a script to spawn a browser and run cmds from the tool to test our UI. I ran the following manually:
ssh -X user#remote_test_server /usr/bin/firefox
However, the remote server says:
Error: no display specified
Is there a way to spawn a browser for automated testing from one headless server to another? Thanks in advance for your help.
I faced a similar problem when I tried to automate a GUI installation program. While there are quite some different possibilities to choose from (e.g. Xnest, Xephyr?), I ended up using vncserver, because it's relatively easy to debug the GUI session this way.
You need to create a vncpassword file, I think:
mkdir -p $HOME/.vnc
chmod 0700 $HOME/.vnc
echo MyLittlePassword | vncpasswd -f > $HOME/.vnc/passwd
chmod 0600 $HOME/.vnc/passwd
Starting the server is then quite straightforward
vncserver
export DISPLAY=:1
/usr/bin/firefox&
...
Now it is possible to connect to the VNC server with a VNC viewer of your choice. But beware there may be no window manager, depending on the X startup scripts of your environment.
Shutting the server down
vncserver -kill :1
In the configuration of Jenkins project , specify the
Build Environment
Start Xvfb before the build, and shut it down after.
#

Categories