From 8d250c17c092b6bbde6630e99ddea165d80eefc2 Mon Sep 17 00:00:00 2001 From: dx-tan Date: Thu, 7 Dec 2023 17:22:47 +0700 Subject: [PATCH 1/3] Update FE Dockerfile --- cope2n-fe/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cope2n-fe/Dockerfile b/cope2n-fe/Dockerfile index 0b4e68c..99ed5df 100644 --- a/cope2n-fe/Dockerfile +++ b/cope2n-fe/Dockerfile @@ -13,11 +13,11 @@ USER node ################### FROM node:16-alpine AS build WORKDIR /app/ +ENV NODE_ENV production COPY --chown=node:node package*.json ./ COPY --chown=node:node --from=development /app/node_modules ./node_modules COPY --chown=node:node . . RUN npm run build -ENV NODE_ENV production RUN npm ci --only=production && npm cache clean --force USER node From d00ededd172ea4052642aa23803b2b37c28da4a9 Mon Sep 17 00:00:00 2001 From: dx-tan Date: Thu, 7 Dec 2023 17:23:30 +0700 Subject: [PATCH 2/3] Update mils --- .gitignore | 6 ++++++ curl_cmds.txt | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1ae0e35..b86e5ac 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,9 @@ __pycache__ migrations/ test/ ._git/ +sdsvkvu_/ +cope2n-api-/ +media/ +postgres_data/ +curl.md +cope2n-api/fwd_api/commands/init_database.py diff --git a/curl_cmds.txt b/curl_cmds.txt index 658a3fe..03dffdf 100644 --- a/curl_cmds.txt +++ b/curl_cmds.txt @@ -23,11 +23,11 @@ curl -X 'POST' \ -H 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6InhodXllbiIsImV4cGlyZWRfYXQiOiIxNC8xMC8yMDM0IDAyOjEyOjIyIiwiaW50ZXJuYWxfaWQiOjM2LCJzdGF0dXMiOjEsInN1YnNjcmlwdGlvbl9pZCI6MzN9.M4McUHsRmcO7X3fa4AlQmmzx_QrHjS2TbwqO9D7JSA73yaqBajpRUTos-wGmX-Sor8YNvd6TtVZOzaNqWFKQaw' \ -H 'Content-Type: multipart/form-data' \ -H 'X-CSRFTOKEN: 9iW1pPLUUtYFzBpwTaLgUSfCaQQBZ9uvfsTjwDV1OuPBGhAKUOkiyhLFuWkP33ta' \ - -F 'imei_files=@"/mnt/hdd4T/TannedCung/OCR/FI-SBT-demo/test_images/handsomeian@gmail.com TV.jpg";type=image/jpeg' \ - -F 'imei_files=@"/mnt/hdd4T/TannedCung/OCR/FI-SBT-demo/test_images/handsomeian@gmail.com RS.png";type=image/png' \ - -F 'invoice_file=@"/mnt/hdd4T/TannedCung/OCR/FI-SBT-demo/test_images/handsomeian@gmail.com TV.jpg";type=image/jpeg' \ + -F 'imei_files=@"./test_images/handsomeian@gmail.com TV.jpg";type=image/jpeg' \ + -F 'imei_files=@"./test_images/handsomeian@gmail.com RS.png";type=image/png' \ + -F 'invoice_file=@"./test_images/Invoice.jpg";type=image/jpeg' \ -F 'redemption_ID="12"' -curl --location 'http://42.96.42.13:9880/api/ctel/result/SAP9f9da237887844f6baf286d2d81c57f4/' \ +curl --location 'http://42.96.42.13:9880/api/ctel/result/SAP659c495e8d684a779527c01345f248c0/' \ --header 'accept: */*' \ --header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6InhodXllbiIsImV4cGlyZWRfYXQiOiIxNC8xMC8yMDM0IDAyOjEyOjIyIiwiaW50ZXJuYWxfaWQiOjM2LCJzdGF0dXMiOjEsInN1YnNjcmlwdGlvbl9pZCI6MzN9.M4McUHsRmcO7X3fa4AlQmmzx_QrHjS2TbwqO9D7JSA73yaqBajpRUTos-wGmX-Sor8YNvd6TtVZOzaNqWFKQaw' \ No newline at end of file From d38541802227e8be92b007d16b4db2eea58b6ffa Mon Sep 17 00:00:00 2001 From: dx-tan Date: Thu, 7 Dec 2023 17:23:49 +0700 Subject: [PATCH 3/3] Update: Route to /api --- cope2n-fe/src/requests/api.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cope2n-fe/src/requests/api.ts b/cope2n-fe/src/requests/api.ts index d563d4d..5874daf 100644 --- a/cope2n-fe/src/requests/api.ts +++ b/cope2n-fe/src/requests/api.ts @@ -2,11 +2,7 @@ import axios, { AxiosError, HttpStatusCode } from 'axios'; import { TOKEN_KEY } from '../consts'; import { getLocale } from '../i18n'; -const BASE_PATH = - process.env.NODE_ENV === 'production' - ? `${process.env.VITE_API_BASE_URL}/api` - : '/api'; - +const BASE_PATH = '/api'; export const API = axios.create({ baseURL: BASE_PATH, withCredentials: false,