Using Angular Ionic and node.js - how to listen to the server? - angularjs

I am relatively new to node.js and super new to Ionic and am super confused. As I was looking online for answers, I came across one blog which would say that I have to runnodejs server using node (in my case) nam start and the app using ionic serve, so lets say I am listening on port 3000, it wouldn't be http://localhost:3000 but something like http://123.456.789.123:3000
I assume that both must listen on the same port?! so if my node.js is listening on port 3000, my ionic must listen on 3000 too?
Running live reload server: http://localhost:35729
Running dev server: http://localhost:8100
I don't understand what http://localhost:35729 means - is it correct to say that Im listening on port 8100
I tried to set my node.js server to listen on port 8100 (probably all wrong what I did) and it doesn't work- can't see anything when I type ip address::8100
Thank you!!

Related

Unable to reach json server from fetch in react native app

I am unable to fetch data from JSON server using the fetch method even I am using the IP address in URL (http://192.168.1.121:3001/).
Its showing error "Network request failed" when I am trying to fetch using react native app but I can access the server using "http://localhost:3001/" in my browser.
I searched a lot on google, everyone is saying use an IP address instead of localhost, I tried this too but still no response from the server.
Please help me to sort it out it would be great for me.
Thankx!
I solved it out by starting my server by providing IP to it...
json-server --watch db.json -p 3001 -d 2000 --host 192.168.1.121
Are you using the IP Address of your PC? it has to be the IP Address from your Pc where you are developing your App - if you are running it on an Emulator. Check your Network Config on your PC and take the IPV4 Address and try that.

Hasura quickstart hello-react not running

I cloned a hello-react app from the Hasura Hub, deployed it but it is not running.
I get a message saying-
This typically happens when there is a port configuration error.
Check that the value of service.spec.ports.targetPort in
microservices/ui/k8s.yaml is the port where your microservice is running.
In the k8s.yaml file the port no. for targetPort is 8080
On running hasura ms logs -n user ui the react scripts start and says
starting the development server
I am not familiar with Hasura but if it has to match with the port where your React app is running, then port configuration must be 3000 since CRA dev server runs on this port.

How to open localhost:8080 in Cloud9 IDE?

I am developing an app engine project (golang) in Cloud9 IDE. For testing in desktop i would go to localhost:8080 in my desktop browser.
In Cloud9, I tried https://workspace-username.c9.io with $PORT set as 8080, but somehow its not working for appengine project. But it is working for normal go web project though.
How do i test app engine application in Cloud9 IDE? or
How do i open http://localhost:8080 in Cloud9 IDE?
Available ports on a hosted Cloud9 workspace
If you're developing a server application, please note that you need
to listen to 0.0.0.0 ($IP) and 8080 ($PORT). Listening to this port
will enable your app to be viewable at https://-.c9users.io
You can also bind to ports 8081, and 8082, which can be accessed by
https://-.c9users.io:8081 and https://-.c9users.io:8082 respectively.
Please note that 8080, 8081, and 8082 are the only available ports on
a hosted Cloud9 workspace.
How to connect to the process running on 'localhost' that is inside of cloud9 server
I see some users are looking for the answer for this, So here is how to do it.
instead of "goapp serve" use "goapp serve -host 0.0.0.0"
credits to Cloud9 support team.
For Google App Engine running Python, the command would be
dev_appserver.py app.yaml --host $IP --port $PORT --admin_host $IP --admin_port 8081
You can also specify the admin host/port. Since Cloud 9 allows access to 8081 and 8082, you can use either of those as your admin ports. For me, the admin console did not open with the Cloud9 preview, but did open in a new tab within my browser.
$IP and $PORT are both environment variables for Cloud 9, with the values of 0.0.0.0 and 8080 respectively.
Edit:
With the most recent gcloud update (March 2018), you don't have to change the IP or PORT, but you do need to figure out how to work around the host whitelisting issue.
My non-ideal workaround is to add a flag to not check for hosts --enable_host_checking=false.
dev_appserver.py app.yaml --enable_host_checking=false
There's an unanswered Cloud 9 post around this issue (link to c9 forum). My guess is that you can add $C9_HOSTNAME as the host, but that doesn't quite work for me.
Interactive Console
If you want to use the interactive console you need to assign the admin port and also use the `--enable_console' flag.
dev_appserver.py app.yaml --enable_host_checking=false --admin_port 8081 --enable_console=true

How to use taskqueues with GAE 1.7.7 behind a proxy

I upgraded to GAE 1.7.7 today and found out that task queues stopped working on my development setup.
I'm using https on my development environment through an nginx set up to proxy the connections from fakedomain.local:80 and fakedomain.local:443 to localhost:8080 (where GAE listens).
With this setup, taskqueues end up being created to be executed at fakedomain.local:80. This used to work because the request would be picked up by nginx, but the version 1.7.7 of the development server seems to have a port registry which won't serve a request unless the port is known (if I understand google.appengine.tools.devappserver2.Dispatcher._resolve_target correctly). Of course, GAE listens on port 8080 and my tasks marked to run on fakedomain.local:80 never get executed (GAE logs this error: An error occured while sending the task "task1" (Url: "...") in queue...).
I tried patching dispatcher.py:577 so instead of raising a ServerDoesNotExistError when the port is not known it will just use the default server. With this modification I can get the taskqueues running again, but I'd rather use a solution which doesn't involve changing GAE's code.
How can I make GAE register the port 80 and 443 in version 1.7.7? Alternatively, is there a way I could specify the complete target URL for the task? (ie fakedomain.local:8080/my_task, instead of just /mytask).
taskqueue.add(target=taskqueue.DEFAULT_APP_VERSION, ...)
will run it on your default app, which should do exactly what you want.
taskqueue.DEFAULT_APP_VERSION =>
app_identity.get_default_version_hostname() =>
environ['DEFAULT_VERSION_HOSTNAME'] =>
'%s:%s' % (environ['SERVER_NAME'], server_port)

could not connect to local host

Recently i installed apache tomcat 6 on my PC.I started the server and try to open the tomcat manager using the url:
http://localhost:8081/manager/html
8081 is the connector port i used at the time of installation and no other services using this port.But its shows the error like
Oops! Google Chrome could not connect to localhost:8081
I used this with differnt browsers IE and crome but still getting the same error
Please provide me the solving to getrid of this.
Try the "Test your Install" section here.
first make sure the your server is running correctly by connect to http://localhost:8081/

Resources