From b41d82e0fbf2726c2cf2585747e2bae9deba1522 Mon Sep 17 00:00:00 2001
From: "Dominik.Sigmund" <dominik.sigmund@br.de>
Date: Sat, 24 Feb 2024 23:38:18 +0100
Subject: [PATCH] Add openapi definitions and fix package.main

---
 .vscode/settings.json |  5 +++++
 index.js              | 27 +++++++++++++++++++++++++++
 package.json          |  4 ++--
 3 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 .vscode/settings.json

diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..8a049e0
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,5 @@
+{
+  "[markdown]": {
+    "editor.cursorSurroundingLines": 0
+  }
+}
\ No newline at end of file
diff --git a/index.js b/index.js
index 574bdbd..e33e084 100644
--- a/index.js
+++ b/index.js
@@ -47,3 +47,30 @@ function metaRoutes(app, { version, config, isServiceReady, metricsEndpoint }, r
 }
 
 module.exports = metaRoutes;
+/**
+   * GET /_version
+   * @summary Returns the version of the service
+   * @tags meta
+   * @return {string} 200 - The version of the service
+   */
+  /**
+   * GET /_config
+   * @summary Returns the configuration of the service with redacted secrets
+   * @tags meta
+   * @return {object} 200 - The configuration of the service
+   */
+  /**
+   * GET /_health
+   * @summary Returns the health of the service
+   * @description This endpoint is used to check if the service is healthy and should always return 200
+   * @tags meta
+   * @return {string} 200 - OK
+   */
+  /**
+   * GET /_ready
+   * @summary Returns the readiness of the service
+   * @description This endpoint is used to check if the service is ready and should return 200 if the service is ready to serve requests
+   * @tags meta
+   * @return {string} 200 - OK
+   * @return {string} 503 - Service Unavailable
+   */
\ No newline at end of file
diff --git a/package.json b/package.json
index 0839013..372aebd 100755
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
 {
   "name": "@libs/metaroutes",
-  "version": "1.0.0",
+  "version": "1.1.0",
   "description": "Add default metaroutes to express app",
-  "main": "index.ts",
+  "main": "index.js",
   "scripts": {
     "test": "jest",
     "test:mutation": "stryker run"
-- 
GitLab