Skip to content

In this example, you will learn how to execute a runtime NodeJS app in your SAP Business Application Studio on consuming the Launchpad Notification API domain services.

License

Notifications You must be signed in to change notification settings

jacobahtan/bootcamp-lp-bookshop-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bookshop Solution for SAP BTP Developer Bootcamp - SAP Launchpad Service with Notifications API

This project is developed for the purpose of an organised partner bootcamp. Participants may clone the repository, install/build & run on your local environment or (recommended) SAP Business Application Studio.

It is for an extended use case based on the topic of Digital Experience - SAP Launchpad Service; to illustrate a simple bookshop management solution with Notifications API Domain services.

To deploy this successful, please make sure you've completed the pre-requisite section.

Runtime Demo of Notifications API in SAP Launchpad

Notifications API for SAP Launchpad Service

Pre-requisites

  1. Deployed the Bookshop solution that is based on SAP Cloud Application Programming model, in your SAP Business Technology Platform trial account.

CAP Deployment 01 CAP Deployment 02

  1. Enable notification for custom applications on SAP BTP To enable custom apps to publish notifications, they need to send data to the service via a destination.

Follow this guide to generate the notification service’s credentials and create a destination based on these credentials. Launchpad Notifications Destination

Launchpad site settings in the admin UI. Notifications Setup 01

Don’t forget to enable the “Show Notifications” settings of the Launchpad site that you want to use. Notifications Setup 02

Let's Get Started

Step 1: Clone this Git Repo into a bookshop-lp project folder.

git clone https://github.com/jacobahtan/bootcamp-lp-bookshop-notifications.git bookshop-lp

Step 2: Create the required Service Keys for Local Runtime in SAP BAS. We will be utilising the existing SAP BTP services we've created for the bookshop solution to create additional service keys for the run time operation.

(Note: below will only work if you've followed strictly to deploy the bookshop solution as part of the pre-requisite, where 2 BTP services would have been created automatically for you - bookshop-xsuaa-service & bookshop-destination-service)

cf create-service-key bookshop-xsuaa-service uaa-key
cf create-service-key bookshop-destination-service destination-key
cf service-key bookshop-xsuaa-service uaa-key 
cf service-key bookshop-destination-service destination-key

Replace each respective service key into the respective section of the default-env.json file.

Hint: Click here to find out how and where to insert the service key credentials.

Step 3: Install required dependencies and run it locally.

Navigate into your bookshop-lp folder, and then run the following commands.

cd bookshop-lp
npm install
npm start

Complete

Congratulations! You have just triggered your first notification from a custom-built app successfully.

Notifications API for SAP Launchpad Service

Alternatively to running the application locally, you can also execute an HTTP client script that does the same for you.

If you are faced with any problem in regards to the example application or the description, feel free to create an issue.

References

This repository project took reference from this blog post, so do give it a good read for more explanation & breakdown.

License

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

About

In this example, you will learn how to execute a runtime NodeJS app in your SAP Business Application Studio on consuming the Launchpad Notification API domain services.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published