Skip to content

Sample project with a preconfigured Approuter and the required backing services to forward all incoming requests to the HTML5 Application Repository service.

License

Notifications You must be signed in to change notification settings

stesap/html5-app-repo-router

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML5 Application Repository Router

Requirements

  • Create an SAP Cloud Platform trial account in the region Europe (Frankfurt)

  • Node.js LTS version 10: https://nodejs.org/en/download/

  • The Cloud Foundry command line tool cf : Tutorial

  • The Multi-Target Application Cloud Foundry CLI Plugin (CF MTA Plugin) :

    cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
    cf install-plugin multiapps
    
  • Make : https://www.gnu.org/software/make/

    With regards to Make: if you are running macOS or Linux it's likely that you'll already have make installed. For Windows users, please use the Chocolatey package manager to install make via choco install make. After installation, please check you can start the executable (make) from the terminal.

Download and Installation

  1. Download the source code
    git clone https://github.com/SAP-samples/html5-app-repo-router
    cd html5-app-repo-router
    
  2. Build the project
    npm install
    npm run build
    
  3. Deploy the project
    cf deploy mta_archives/html5_router_1.0.0.mtar
    

You can find the URL of the app router after the deployment has been successful in the console output. It will have the following structure: https://[globalaccount-id]-[subaccount-id]-dev-html5-app-repo-router.cfapps.eu10.hana.ondemand.com.

Configuration

You can change path to the default app if you wish. To do so, edit the welcomeFile property in the xs-app.json configuration file of the app router.

You might encounter a 503 Service Temporarily Unavailable error when there is no HTML5 application which the defined name in the application repository.

HTML5 Apps Deployment

The application repository can hold any UI project independent of the used framework. Leverage the following commands of the Cloud Foundry CLI plugin to uplaod UI apps to the application repository.

mkdir myapp
cd myapp
echo '{"sap.app":{"id":"myapp","applicationVersion":{"version": "1.0.0"}}}' > manifest.json
echo '{"routes":[{"source":"^(.*)","target": "$1","service":"html5-apps-repo-rt"}]}' > xs-app.json
cf html5-push

This blog post describes how to upload a react-based application to the HTML5 application repository.

Known Issues

None so far :)

How to obtain support

This content is provided "as-is" with no other support.

License

Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the SAP Sample Code License except as noted otherwise in the LICENSE file.

About

Sample project with a preconfigured Approuter and the required backing services to forward all incoming requests to the HTML5 Application Repository service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published