Skip to content

robertwitt/cap-remote-openapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAPI Remote Service

This is a simple CAP application to demonstrate how to invoke an OpenAPI-documented API via CAP's Remote Service API.

This project contains a service that exposes an endpoint /Sites to get basic information of a facility or site. The bound function /Sites/<ID>/getCurrentWeather() internally invokes a REST API of OpenWeatherMap.org to get the current weather at the given site.

Prerequisite

You need to register at OpenWeatherMap.org and generate an API key in order to execute the requests locally.

Having generated an API key, you may need to wait until it is activated in the system; until then, you will receive HTTP status 401 responses to the API requests.

Run locally

Start the server locally and pass the API key as environment variable API_KEY:

API_KEY=<your API key> cds watch

You can execute the sample requests in requests.http to see the effect.

About

Demo of CAP OpenAPI Remote Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •