From 125cb6e5c24d82a631efe3264c6edcc1c434e6f6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Mar 2020 08:35:31 +0100 Subject: [PATCH] Added hello world --- hello/package.json | 20 ++++++++++++++++++++ hello/test.http | 1 + hello/world.cds | 3 +++ hello/world.js | 3 +++ reviews/package.json | 4 ++-- 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 hello/package.json create mode 100644 hello/test.http create mode 100644 hello/world.cds create mode 100644 hello/world.js diff --git a/hello/package.json b/hello/package.json new file mode 100644 index 00000000..3282f8bf --- /dev/null +++ b/hello/package.json @@ -0,0 +1,20 @@ +{ + "name": "@capire/reviews", + "version": "1.0.0", + "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", + "scripts": { + "watch": "cds serve world.cds" + }, + "cds": { + "requires": { + "db": { + "kind": "sql" + }, + "messaging": { + "kind": "file-based-messaging" + } + } + }, + "license": "SAP SAMPLE CODE LICENSE" +} \ No newline at end of file diff --git a/hello/test.http b/hello/test.http new file mode 100644 index 00000000..e3ab0a6f --- /dev/null +++ b/hello/test.http @@ -0,0 +1 @@ +GET http://localhost:4004/say/hello(to='world') diff --git a/hello/world.cds b/hello/world.cds new file mode 100644 index 00000000..54bf59fa --- /dev/null +++ b/hello/world.cds @@ -0,0 +1,3 @@ +service say { + function hello (to:String) returns String; +} diff --git a/hello/world.js b/hello/world.js new file mode 100644 index 00000000..ff1a370e --- /dev/null +++ b/hello/world.js @@ -0,0 +1,3 @@ +module.exports = class say { + hello(req) { return `Hello ${req.data.to}!` } +} diff --git a/reviews/package.json b/reviews/package.json index bb996e51..d1142aad 100644 --- a/reviews/package.json +++ b/reviews/package.json @@ -3,7 +3,6 @@ "version": "1.0.0", "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", - "license": "SAP SAMPLE CODE LICENSE", "files": [ "db", "srv", @@ -21,5 +20,6 @@ "kind": "file-based-messaging" } } - } + }, + "license": "SAP SAMPLE CODE LICENSE" } \ No newline at end of file