This commit is contained in:
Daniel
2020-03-02 01:22:59 +01:00
parent 26d7fc767c
commit 9921b2f3de
56 changed files with 34 additions and 66 deletions

1
NOTICE
View File

@@ -1 +0,0 @@
Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.

View File

@@ -1,71 +1,46 @@
# cloud-cap-samples # Welcome to cap/samples
This is a monorepository for sample projects on [SAP Cloud Application Programming Model](https://cap.cloud.sap). Find here code samples for the [SAP Cloud Application Programming Model](https://cap.cloud.sap) oganised in a simplistic monorepo.
## Description ## Preliminaries
This repository provides a list of samples and reusable packages created based on SAP Cloud Application Programming Model. - [Install @sap/cds-dk](https://cap.cloud.sap/docs/get-started/) as documented in capire
The SAP Cloud Application Programming Model enables you to quickly create business applications by allowing you to focus on your domain logic. It offers a consistent end-to-end programming model that includes languages, libraries and APIs tailored for full-stack development on SAP Cloud Platform.
The samples provided can be run in a local setup on SQLite Database.
## Requirements ## Download
* [Node.js](https://nodejs.org/en/) v8 or higher
* [Git](https://git-scm.com)
* [SQLite DB](https://www.sqlite.org/download.html) (Windows only; pre-installed on Mac/Linux)
#### Optional (if you want to import the code into an editor) Clone this repo as shown below, if you have [git](https://git-scm.com/downloads) installed,
* [VS Code](https://code.visualstudio.com) otherwise [download as zip file](archive/master.zip).
* [Add CDS extension to VS](https://cap.cloud.sap/docs/get-started/in-vscode#add-cds-editor)
## Download and Installation
#### Install `cds` development kit
```sh ```sh
# `@sap`-scoped packages are set via .npmrc git clone https://github.com/sap-samples/cap samples
npm install -g @sap/cds-dk cd samples
cds #> test-run it
``` ```
Got issues? Check out the [documentation](https://cap.cloud.sap/docs/get-started/).
#### Clone and build the application ## Setup
`git clone https://github.com/SAP-samples/cloud-cap-samples samples && cd samples && npm i`
#### Run the samples In the samples folder run:
```sh
npm install
```
With that you're ready to run the samples, e.g. start the [_bookshop_](./packages/bookshop) sample as follows: ## Run
`npm run bookshop` With that you're ready to run the samples, for example:
```sh
npm run bookshop # or...
npm run bookshop-fiori
```
## Test After that open this link in your browser: <http://localhost:4004>
For example, try these links in your browser:
- <http://localhost:4004> to test with generic index page.
- <http://localhost:4004/fiori.html> to test with Fiori sandbox.
## Debug ## Get Support
For example, in [VS Code](https://code.visualstudio.com) switch to _Debug_ view and launch one of the prepared _cds run_ launch configurations. Check out the cap docs at https://cap.cloud.sap. <br>
In case you find a bug or need support, please [open an issue in here](https://github.com/SAP-samples/cloud-cap-samples/issues/new).
## Limitations
None
## Known Issues
None
## How to obtain support
Check out the documentation on https://cap.cloud.sap. In case you find a bug, or you need additional support, please open an issue [here](https://github.com/SAP-samples/cloud-cap-samples/issues/new) in GitHub.
## To-Do (upcoming changes)
None
## License ## License
Copyright (c) 2019 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](/LICENSE) file. Copyright (c) 2019 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](/LICENSE) file.

View File

@@ -4,14 +4,12 @@
"description": "A simple bookshop application, build in a self-contained all-in-one fashion, i.e. w/o reusing other packages.", "description": "A simple bookshop application, build in a self-contained all-in-one fashion, i.e. w/o reusing other packages.",
"license": "SAP SAMPLE CODE LICENSE", "license": "SAP SAMPLE CODE LICENSE",
"dependencies": { "dependencies": {
"@capire/common": "*", "@capire/common": "*"
"@sap/cds": "*",
"express": "*"
}, },
"scripts": { "scripts": {
"start": "cds run --in-memory?", "start": "cds run --in-memory?",
"watch": "cds watch", "watch": "cds watch",
"test:genres": "cds serve test/genres --in-memory" "test:genres": "cds serve tests/genres.cds --in-memory"
}, },
"cds": { "cds": {
"requires": { "requires": {

View File

@@ -5,10 +5,7 @@
"license": "SAP SAMPLE CODE LICENSE", "license": "SAP SAMPLE CODE LICENSE",
"dependencies": { "dependencies": {
"@capire/bookshop": "*", "@capire/bookshop": "*",
"@capire/genres": "*", "@capire/common": "*"
"@capire/common": "*",
"@sap/cds": "*",
"express": "*"
}, },
"scripts": { "scripts": {
"start": "cds run --in-memory?", "start": "cds run --in-memory?",

View File

@@ -5,14 +5,15 @@
"author": "daniel.hutzel@sap.com", "author": "daniel.hutzel@sap.com",
"private": true, "private": true,
"scripts": { "scripts": {
"bookshop": "cds watch bookshop" "bookshop": "cds watch bookshop",
"bookshop-fiori": "cds watch fiori"
}, },
"dependencies": { "dependencies": {
"@capire/bookshop": "./bookshop", "@capire/bookshop": "file:bookshop",
"@capire/genres": "./genres", "@capire/common": "file:common",
"@capire/common": "./common" "@capire/reviews": "file:reviews"
}, },
"--add-these-to-devDependencies-for-tests": { "add-these-to-devDependencies-for-tests": {
"@types/jest": "*", "@types/jest": "*",
"jest": "*" "jest": "*"
}, },

View File

@@ -1,12 +1,10 @@
{ {
"name": "@sap/capire-reviews", "name": "@capire/reviews",
"version": "1.0.0", "version": "1.0.0",
"description": "A reuse service providing generic means to add reviews and ratings to target objects, e.g. products.", "description": "A reuse service providing generic means to add reviews and ratings to target objects, e.g. products.",
"repository": "https://github.com/SAP-samples/cloud-cap-samples.git", "repository": "https://github.com/SAP-samples/cloud-cap-samples.git",
"license": "SAP SAMPLE CODE LICENSE", "license": "SAP SAMPLE CODE LICENSE",
"dependencies": { "dependencies": {
"@sap/cds": "latest",
"express": "*"
}, },
"scripts": { "scripts": {
"start": "cds run --in-memory?", "start": "cds run --in-memory?",