Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 

how to run the nodejs app without port? currently it is running with port 3005

how to run the nodejs app without port? currently it is running with port 3005

jawad
Long-established Member

Hi, 
i have nodejs app with express server. installed correctly on ctrlx Core virtual. showing on side bar, upon click on app it runs on ctrlx like this https://{ip}:3005/project1

But i want to run it without port https://{ip}/project1
how i can do it?
here is code screenshot of code which is running,

jawad_0-1710827023783.png

Now i change the port to default port 80 . it runs on local system correctly, but when i built its snap and installed on ctrlx core virtual it says: 

404 – Page not found

There is no page available under the path /project1.

 

jawad_1-1710827138219.png

 

 

5 REPLIES 5

Sgilk
Frequent Contributor

Hi @jawad ,

First of all, port 80 is the default HTTP port, so you would access at http://{ip}/project1, but this will not work when hosted on the ctrlX CORE.

You'll want to continue hosting on a port and specify it in your Package Assets proxy mapping.

jawad
Long-established Member

Hi @Sgilk Thanks for response.
let me tell you, i want to access token save in session storage of ctrlx core. but when i open my app, session storage get cleared. i removed the port no and then tested after building snap app, the app doesnot runs and says 404 page not found. but session storage exists. so i want the solution for session storage in my app when i run it with port.

Aove mentioned package assets documentation, I bind the port no like below in screenshot

jawad_0-1710911570747.png


but still it doesnot works and says me .

404 – Page not found


CodeShepherd
Community Moderator
Community Moderator

Moved to corresponding sub forum SDK.

Sgilk
Frequent Contributor

@jawad ,

Could you please clarify this piece a little bit? What are you trying to achieve here?

"i want to access token save in session storage of ctrlx core. but when i open my app, session storage get cleared"

Regarding the port, you will still need to bind it in your express server application. The proxy mapping in the package assets is simply redirecting requests recieved on the specified url to the specified binding. This means you can access the express server without providing a port in the URL.

Also, you should not provide the IP address in the proxyMapping url field. Just use "/project1" in your example.

CodeShepherd
Community Moderator
Community Moderator

Are there any news? Could this issue been solved?

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