cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

How to run app on vm ctrlx works

How to run app on vm ctrlx works

jawad
Long-established Member

I have installed snap of cpp hello world basic example from examples of sdk automation on virtual ctrlx works, it installed successfully, but now showing in sidebar, 

secondly how to run this on ctrlx vm ?

6 REPLIES 6

CodeWasi
Occasional Contributor

Hello jawad,
could you please have a look in the readme --- there is not sidebar-integrated item/info. The hello World is printed in the log-book info.
https://github.com/boschrexroth/ctrlx-automation-sdk/tree/main/samples-cpp/hello.world

Bye

Sgilk
Contributor

All this example does is print out "Hello World" to the diagnostic logbook. This should happen automatically upon installation. See the associated README.md.

Hello World Readme 

jawad
Long-established Member

Ok. now if i have nodejs based application, how i can run it on ctrlx works. 

for example i have following routes in my nodejs app, 

app.get('/items', (req, res) => {
       res.send('Hello, Express!')
});

how i can run or test this routes ?

Jawad, 

You have to create a snap and then implement your nodeJS snapp. 😃, You have to dump your code inside the app with the dump Plugin 
and then modify the HELLOWORD to run "node yourapp.js"

so basically: 

- have the app the works locally

- include in the app the nodejs binaries (already done in helloword)

- modify the app to start your code at boot. 

https://snapcraft.io/docs/dump-plugin 

This is my structure:

MauroRiboniMX_0-1699375673438.png

the code folder:

MauroRiboniMX_1-1699375699009.png

the wrapper 

MauroRiboniMX_2-1699375756917.png

my app with the code imported: 

MauroRiboniMX_3-1699375818603.png

I am planning to make an how-to out of this but there will be no more informaitons than what is written here. 

 

Mauro 

jawad
Long-established Member

ok. how I can run my snap app on CtrlX works virtual core after installation. 
let say I have this route written in my code 

app.get('/items', (req, res) => {
    const items = ['Item 1', 'Item 2', 'Item 3'];
    res.json(items);
});


How I can test it?

jawad
Long-established Member

Thanks @Mauro

I achevied this simply by accessing ip address defined in virtual ctrlx, port and routes defined in code. 

jawad_0-1700052861759.png

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist