FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
10-26-2023 02:03 PM
I have nodejs snap application, in which express server is used,
here is express app.js code
10-26-2023 03:03 PM
Hello,
If your snap has this app set as a daemon the process is started at boot.
Regarding Express JS: you have to start from an example and modify it in order to achieve your result.
Mauro
10-26-2023 03:11 PM
here is my snapcraft.yaml
what changes should i do it?
and i have installed it on ctrlx works
10-26-2023 03:33 PM
It looks like the app is installed correctly. Can you not access your routes?
Ex. http://localhost:3000/items
If after reboot and switching the control into operating mode you still cannot access, there may be a problem with the app.
You can view the status & logs over SSH in the virtual CORE. Under device settings in ctrlX Works, select this option.
Then, log into the QEMU emulator using the credentials below.
Username: rexroot
Password: rexroot
Run the commands below to find your app name and view the snap logs.
sudo snap list
sudo snap logs app_name
Additional information can be found by
sudo systemctl status
sudo journalctl
10-26-2023 03:36 PM
Hello,
The address should be http://192.168.1.1:3000.. not localhost. Used in port forwarding would be http://localhost:3000.. but you have to forward the right port.
Mauro
10-27-2023 06:46 AM
currenty i am doing what you mentioned above. but it doesnot works, anything else should i do?
10-27-2023 07:23 AM
i check log book , but i donot what are these issues and how i can solve it.
10-27-2023 03:14 PM
The node-project.app is failing to start. At this point, I'd definitely suggest trying to debug the app using the logging tools I provided in my last comment. The log book does not necessarily provide all relevant information.
10-30-2023 11:41 AM - edited 10-30-2023 11:46 AM
This code works fine with express server installed and imported, but api are commented.
10-30-2023 02:28 PM
I agree there is a problem and that is why I suggest debugging over SSH as described above. My guess is a problem importing the express library, but it is difficult to know without better error messages. The logbook logs do not contain all possible information.
09-12-2024 12:51 PM
@jawad Are there any news? Could this issue been solved?