diff --git a/app-connector-client/package.json b/app-connector-client/package.json index 07831446..6f8aeaaf 100644 --- a/app-connector-client/package.json +++ b/app-connector-client/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/app-connector-client", - "version": "0.0.0", + "version": "0.1.0", "description": "Client for Kyma application connectivity", "main": "server/app.js", "scripts": { @@ -30,7 +30,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@varkes/example-kyma-mock": "^0.0.0", + "@varkes/example-kyma-mock": "^0.1.0", "mocha": "^6.0.2", "nyc": "^13.3.0", "supertest": "^3.4.2" @@ -43,4 +43,4 @@ "varkes-connector-cli": "./tools/cli.js", "varkes-connector-server": "./server/server.js" } -} \ No newline at end of file +} diff --git a/app-connector-client/server/app.js b/app-connector-client/server/app.js index 4b546a79..3e0add1a 100644 --- a/app-connector-client/server/app.js +++ b/app-connector-client/server/app.js @@ -13,7 +13,7 @@ const connector = require("./routes/connector"); const events = require("./routes/events") var apis = require("./routes/apis") var keys = require("./keys") - +const VARKES_LOGO = path.resolve(__dirname, 'views/static/logo.svg') module.exports = function (varkesConfigPath = null, nodePortParam = null) { var app = express() app.use(bodyParser.json()); @@ -36,7 +36,11 @@ module.exports = function (varkesConfigPath = null, nodePortParam = null) { app.get("/", function (req, res) { res.render('index', { appName: varkesConfig.name }) }) - + app.get("/logo", function (req, res) { + var img = fs.readFileSync(varkesConfig.logo || VARKES_LOGO); + res.writeHead(200, { 'Content-Type': "image/svg+xml" }); + res.end(img, 'binary'); + }); app.get("/metadata", function (req, res) { res.sendFile(path.resolve(__dirname, "resources/api.yaml")) }) diff --git a/app-connector-client/server/config.js b/app-connector-client/server/config.js index 54b4c220..d9bc2c13 100644 --- a/app-connector-client/server/config.js +++ b/app-connector-client/server/config.js @@ -56,6 +56,9 @@ function configValidation(configJson) { } } } + if (configJson.logo && !configJson.logo.match(/^.+\.(svg)$/)) { + error_message += "\nlogo image must be in svg format" + } if (error_message != "") { throw new Error("Validation of configuration failed: " + error_message); } diff --git a/app-connector-client/server/views/index.ejs b/app-connector-client/server/views/index.ejs index e148b4c4..2faf714c 100644 --- a/app-connector-client/server/views/index.ejs +++ b/app-connector-client/server/views/index.ejs @@ -21,8 +21,9 @@
-
- +
+ + <%= appName %>
diff --git a/app-connector-client/test/varkes_config.json b/app-connector-client/test/varkes_config.json index 1463346a..5975821d 100644 --- a/app-connector-client/test/varkes_config.json +++ b/app-connector-client/test/varkes_config.json @@ -5,6 +5,7 @@ "404": "{\"error\":\"End Point not found\"}" }, "name": "app-connector-mock", + "logo": "../logos/logo.svg", "events": [ { "specification": "test/events1.json", diff --git a/examples/combined-odata-mock/package.json b/examples/combined-odata-mock/package.json index ea51d0c1..1e7b3a6e 100644 --- a/examples/combined-odata-mock/package.json +++ b/examples/combined-odata-mock/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/example-combined-odata-mock", - "version": "0.0.0", + "version": "0.1.0", "description": "combined example of odata and app-connector-client", "main": "app.js", "private": true, @@ -15,8 +15,8 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@varkes/app-connector-client": "^0.0.0", - "@varkes/odata-mock": "^0.0.0", + "@varkes/app-connector-client": "^0.1.0", + "@varkes/odata-mock": "^0.1.0", "express": "^4.16.4" }, "devDependencies": { @@ -27,4 +27,4 @@ "type": "ssh", "url": "git@github.com:kyma-incubator/varkes.git" } -} \ No newline at end of file +} diff --git a/examples/combined-openapi-mock/package.json b/examples/combined-openapi-mock/package.json index e076a998..5ef908dc 100644 --- a/examples/combined-openapi-mock/package.json +++ b/examples/combined-openapi-mock/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/example-combined-openapi-mock", - "version": "0.0.0", + "version": "0.1.0", "description": "combined example of varkes openapi-mock and varkes app-connector-client", "main": "app.js", "private": true, @@ -15,8 +15,8 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@varkes/app-connector-client": "^0.0.0", - "@varkes/openapi-mock": "^0.0.0", + "@varkes/app-connector-client": "^0.1.0", + "@varkes/openapi-mock": "^0.1.0", "express": "^4.16.4" }, "devDependencies": { @@ -27,4 +27,4 @@ "type": "ssh", "url": "git@github.com:kyma-incubator/varkes.git" } -} \ No newline at end of file +} diff --git a/examples/kyma-mock/package.json b/examples/kyma-mock/package.json index b30efe93..742345db 100644 --- a/examples/kyma-mock/package.json +++ b/examples/kyma-mock/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/example-kyma-mock", - "version": "0.0.0", + "version": "0.1.0", "description": "Standalone example of varkes kyma-mock", "main": "app.js", "private": true, @@ -15,7 +15,7 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@varkes/openapi-mock": "^0.0.0", + "@varkes/openapi-mock": "^0.1.0", "express": "^4.16.4", "uuid": "^3.3.2" }, @@ -27,4 +27,4 @@ "type": "ssh", "url": "git@github.com:kyma-incubator/varkes.git" } -} \ No newline at end of file +} diff --git a/examples/odata-mock/package.json b/examples/odata-mock/package.json index 0e752137..14a595b0 100644 --- a/examples/odata-mock/package.json +++ b/examples/odata-mock/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/example-odata-mock", - "version": "0.0.0", + "version": "0.1.0", "description": "Standalone example of varkes odataapi-mock", "main": "app.js", "private": true, @@ -15,7 +15,7 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@varkes/odata-mock": "^0.0.0", + "@varkes/odata-mock": "^0.1.0", "express": "^4.16.4" }, "devDependencies": { @@ -26,4 +26,4 @@ "type": "ssh", "url": "git@github.com:kyma-incubator/varkes.git" } -} \ No newline at end of file +} diff --git a/examples/openapi-mock/package.json b/examples/openapi-mock/package.json index 885f70f4..89aa45a7 100644 --- a/examples/openapi-mock/package.json +++ b/examples/openapi-mock/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/example-openapi-mock", - "version": "0.0.0", + "version": "0.1.0", "description": "Standalone example of varkes openapi-mock", "main": "app.js", "private": true, @@ -15,7 +15,7 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@varkes/openapi-mock": "^0.0.0", + "@varkes/openapi-mock": "^0.1.0", "express": "^4.16.4" }, "devDependencies": { @@ -26,4 +26,4 @@ "type": "ssh", "url": "git@github.com:kyma-incubator/varkes.git" } -} \ No newline at end of file +} diff --git a/examples/stress-mock/package.json b/examples/stress-mock/package.json index ea007d6d..4c089d90 100644 --- a/examples/stress-mock/package.json +++ b/examples/stress-mock/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/stress-mock", - "version": "0.0.0", + "version": "0.1.0", "description": "combined stress test example of varkes openapi-mock, varkes odata-mock and varkes app-connector-client", "main": "app.js", "private": true, @@ -14,9 +14,9 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@varkes/app-connector-client": "^0.0.0", - "@varkes/openapi-mock": "^0.0.0", - "@varkes/odata-mock": "^0.0.0", + "@varkes/app-connector-client": "^0.1.0", + "@varkes/odata-mock": "^0.1.0", + "@varkes/openapi-mock": "^0.1.0", "express": "^4.16.4" }, "devDependencies": { @@ -27,4 +27,4 @@ "type": "ssh", "url": "git@github.com:kyma-incubator/varkes.git" } -} \ No newline at end of file +} diff --git a/lerna.json b/lerna.json index ca7c3da8..f50c1879 100644 --- a/lerna.json +++ b/lerna.json @@ -5,5 +5,5 @@ "./odata-mock", "./openapi-mock" ], - "version": "0.0.0" + "version": "0.1.0" } diff --git a/odata-mock/package.json b/odata-mock/package.json index c7468e88..a9e8d3c0 100644 --- a/odata-mock/package.json +++ b/odata-mock/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/odata-mock", - "version": "0.0.0", + "version": "0.1.0", "main": "server/app.js", "engines": { "node": ">=4" diff --git a/openapi-mock/package.json b/openapi-mock/package.json index 83acf1ea..d620f389 100644 --- a/openapi-mock/package.json +++ b/openapi-mock/package.json @@ -1,6 +1,6 @@ { "name": "@varkes/openapi-mock", - "version": "0.0.0", + "version": "0.1.0", "private": false, "description": "Open API Mock", "keywords": [],