There is a UI5 sample app:
https://github.com/SAP/openui5-sample-app and it can be easily hosted with:
UI5 serve -o index.html
or with npm run serve-dist
after building
But, how do i host it with express?
There is a UI5 sample app:
https://github.com/SAP/openui5-sample-app and it can be easily hosted with:
UI5 serve -o index.html
or with npm run serve-dist
after building
But, how do i host it with express?
Strictly speaking, you ARE using an express app, when using the UI5 server via the command
UI5 serve -o index.html.
This code initializes the express app.If you want to do it by your own, you can use the following code in an app.js file and start it via
node app.js
:This app basically does nothing else than serving files from the webapp folder. One disadvantage over using the UI5 Server is that you need to provide the resources in some way. You can reference the ui5 resources from a Content Delivery Network if you change the bootstrap script in you index.html file as show here:
This would serve the example app from your self-coded UI5 app.