diff --git a/todo-backend/package-lock.json b/todo-backend/package-lock.json index 38751be..eba31ee 100644 --- a/todo-backend/package-lock.json +++ b/todo-backend/package-lock.json @@ -2878,9 +2878,9 @@ } }, "node_modules/normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true, "engines": { "node": ">=8" @@ -6461,9 +6461,9 @@ "dev": true }, "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true }, "object-assign": { diff --git a/todo-backend/src/Server.ts b/todo-backend/src/Server.ts index aa09f5d..c6dd9a1 100644 --- a/todo-backend/src/Server.ts +++ b/todo-backend/src/Server.ts @@ -1,5 +1,5 @@ import cookieParser from "cookie-parser"; -import express, { Request, Response } from "express"; +import express from "express"; import "express-async-errors"; import cors from "cors"; import { Sequelize } from "sequelize"; @@ -27,17 +27,12 @@ sequelize console.error("Unable to connect to the database:", err); }); +app.get("/", (req, res) => { + res.send("OK"); +}); + // Add APIs app.use("/api", BaseRouter); -// Print API errors -// eslint-disable-next-line @typescript-eslint/no-unused-vars -app.use((err: Error, req: Request, res: Response) => { - console.error(err, true); - return res.status(500).json({ - error: err.message, - }); -}); - // Export express instance export default app; diff --git a/todo-backend/src/entities/Item.ts b/todo-backend/src/entities/Item.ts index 0d4b04d..72ef640 100644 --- a/todo-backend/src/entities/Item.ts +++ b/todo-backend/src/entities/Item.ts @@ -37,9 +37,9 @@ export const TodoItem = sequelize.define( ); // (re-)creates table (NOT database) -if (process.env.DATABASE_INIT === "true") { - TodoItem.sync({ force: true }); -} +// if (process.env.DATABASE_INIT === "true") { +TodoItem.sync({ force: true }); +// } export async function createTodoItem(todoItem: TodoItemCreationAttributes) { return TodoItem.create(todoItem).then((item) => item.get()); diff --git a/todo-helm/todo-list/Chart.lock b/todo-helm/todo-list/Chart.lock index 4b40a0c..e93701c 100644 --- a/todo-helm/todo-list/Chart.lock +++ b/todo-helm/todo-list/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://charts.bitnami.com/bitnami - version: 9.3.14 -digest: sha256:d02eb6a8c2a59ec8b2ef307c9d9b8b2154425d50f061d6ce64e891207a25a445 -generated: "2021-06-08T16:17:55.86153-04:00" + version: 9.3.11 +digest: sha256:6817cd0c1ea845bfd715d8d1be6d57c4b1422bcc243783955136e61fc4380c8c +generated: "2021-06-10T14:22:33.263679-04:00" diff --git a/todo-helm/todo-list/Chart.yaml b/todo-helm/todo-list/Chart.yaml index 6e8424c..1ebe9e7 100644 --- a/todo-helm/todo-list/Chart.yaml +++ b/todo-helm/todo-list/Chart.yaml @@ -25,5 +25,5 @@ appVersion: "1.16.0" dependencies: - name: mariadb - version: 9.3.14 + version: 9.3.11 repository: https://charts.bitnami.com/bitnami diff --git a/todo-helm/todo-list/templates/deployment.yaml b/todo-helm/todo-list/templates/deployment.yaml index 7fc6ed8..fb9a688 100644 --- a/todo-helm/todo-list/templates/deployment.yaml +++ b/todo-helm/todo-list/templates/deployment.yaml @@ -40,7 +40,7 @@ spec: {{- end }} ports: - name: http - containerPort: 80 + containerPort: 3000 protocol: TCP livenessProbe: httpGet: diff --git a/todo-helm/todo-list/values.yaml b/todo-helm/todo-list/values.yaml index 1304008..63dd5bb 100644 --- a/todo-helm/todo-list/values.yaml +++ b/todo-helm/todo-list/values.yaml @@ -5,10 +5,11 @@ replicaCount: 1 image: - repository: nginx - pullPolicy: IfNotPresent + repository: quay.io/gbianco/todo-backend + # pullPolicy: IfNotPresent + pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: latest imagePullSecrets: [] nameOverride: "" @@ -38,7 +39,7 @@ securityContext: {} service: type: ClusterIP - port: 80 + port: 3000 ingress: enabled: false @@ -83,9 +84,9 @@ affinity: {} mariadb: auth: - username: quotes - password: quotespwd - database: quotesdb + username: todo + password: todopwd + database: tododb primary: podSecurityContext: enabled: false @@ -93,11 +94,13 @@ mariadb: enabled: false env: - - name: "QUOTES_HOSTNAME" - value: "famousapp-mariadb" - - name: "QUOTES_DATABASE" - value: "quotesdb" - - name: "QUOTES_USER" - value: "quotes" - - name: "QUOTES_PASSWORD" - value: "quotespwd" + - name: DATABASE_NAME + value: tododb + - name: DATABASE_USER + value: todo + - name: DATABASE_PASSWORD + value: todopwd + - name: DATABASE_SVC + value: todo-list-mariadb + - name: DATABASE_INIT + value: "\"true\""