-
Notifications
You must be signed in to change notification settings - Fork 1
running locally
If you want test the interface between the mirror and the phone, you can get this running locally on your machine. To get cloud-node, mm_web_app, and magic_mirror all running on your local machine if you do the following:
Change the port for mm_web_app. In magic_mirror/angular-cli.json, set the defaults serve port. Like this:
"defaults": {
"serve": {
"port": 5000
},
Change the socket address for mm_web_app. In mm_web_app/src/app/shared/stateInit.ts, change from this:
sync_status: 'unpaired',
socket_url: 'ec2-54-221-218-6.compute-1.amazonaws.com:4000',
}
to this:
sync_status: 'unpaired',
socket_url: 'localhost.com:4000',
}
Change the socket address for magic_mirror. In mm_web_app/src/app/shared/stateInit.ts, change from this:
export const stateInit = {
socket_url: 'ec2-54-221-218-6.compute-1.amazonaws.com:4000',
}
to this:
export const stateInit = {
socket_url: 'localhost.com:4000',
}
You will be able to do ng serve in the magic_mirror directory and see the application at http://localhost:5000/.
You will be able to do ng serve in mm_web_app and see the application at http://localhost:4200/.
To start cloud-node, go to the cloud-node directory and npm run start. If both the magic_mirror and mm_web_app are running, you will see them connect to the cloud-node socket.io like this:
├── NODE_ENV=development ──┤
├── PORT=3000 ──┤
├── SOCKET_PORT=4000 ──┤
├── MAGENTO_URL=https://hats.razoyo.com ──┤
├── MAGENTO_MEDIA_URL=https://hats.razoyo.com/media ──┤
├── MAGENTO_USERNAME=razoyo ──┤
├── MAGENTO_PASSWORD=[REDACTED] ──┤
├── PICTURE_PATH=dist/assets/customer_photos ──┤
Socket Server [PORT: 4000]
Express Server [PORT: 3000] [NODE_ENV: development]
made socket connection, id = R3I98bOMdbRl3iT0AAAA
made socket connection, id = DnWd2wNV19MCGqewAAAB