This project was generated with Angular CLI version 1.6.6
This brilliant websocket socket.io setup tutorial by elliotforbes
We are creating a server and a client that listens for incoming messages.
The server can run on a mobile device and thus emit messages to the client.
The messages are information about the device status.
The result is to maniputale graphics on the screen with our mobile device.
First we need to get the server running:
cd browserServer/
node app.js
This will run your express server.
Then, in the same directory (browserServer), in a new terminal, run:
ng serve --host 0.0.0.0
That way, we will be able to access our local address from a mobile device connected to the same network.
Now, navigate from your mobile device or from your browser to:
<your local IP address>:4200
where the application is running.
You can find your local IP address running
ifconfig
That would be one of your inet addresses.
cd browserClient/
ng serve --port 4000
You need to specify another port than the default 4200, because the server is already running on 4200.
Now, either click the send message button or move your phone around, and see the result in your browser!
Such as Detecting device orientation
and using them to manipulate a cube on our canvas!