From 84da23519cf2f6b83f40c30711cbe37ff2ec6ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B8=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B8=CC=86=20=D0=91=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D1=81=D0=BE=D0=B2=D0=B8=D1=87?= Date: Thu, 6 Nov 2025 19:35:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/README.md | 4 ++-- backend/tests/server_api_test.py | 2 +- frontend/eslint.config.js | 3 +++ frontend/package.json | 1 + frontend/src/network.ts | 7 +++---- frontend/vite.config.ts | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/backend/README.md b/backend/README.md index 9425b99..1aebae3 100644 --- a/backend/README.md +++ b/backend/README.md @@ -82,7 +82,7 @@ This example uses the Web Server Gateway Interface (WSGI) with Django to enable ```bash python manage.py collectstatic -python manage.py runserver 8090 +python manage.py runserver 8091 docker rmi -f docker compose down && docker compose build --no-cache && docker compose up @@ -95,4 +95,4 @@ ssh first@192.168.1.100 less +G /var/lib/docker/containers//-json.log ``` -Your Django application is now available at `http://localhost:8090`. \ No newline at end of file +Your Django application is now available at `http://localhost:8091`. \ No newline at end of file diff --git a/backend/tests/server_api_test.py b/backend/tests/server_api_test.py index 6267c49..37be938 100644 --- a/backend/tests/server_api_test.py +++ b/backend/tests/server_api_test.py @@ -2,7 +2,7 @@ import unittest import requests import uuid -BASE_URL = "http://localhost:8090" +BASE_URL = "http://localhost:8091" def get_error_message(response: requests.Response) -> str: diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 0072a4a..84c2e18 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -23,5 +23,8 @@ export default defineConfig([ ecmaVersion: 2020, globals: globals.browser, }, + rules: { + '@typescript-eslint/no-unused-vars': 'warn', + }, }, ]) diff --git a/frontend/package.json b/frontend/package.json index 3a4f4aa..e4ced4d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,6 +5,7 @@ "description": "Game Shop", "type": "module", "scripts": { + "start": "vite", "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", diff --git a/frontend/src/network.ts b/frontend/src/network.ts index b94b029..c4bed3f 100644 --- a/frontend/src/network.ts +++ b/frontend/src/network.ts @@ -1,5 +1,5 @@ const DEV_URL = '/dev_api' -const PROD_URL = 'https://shop.softwarrior.ru:8090' +const PROD_URL = 'https://shop.softwarrior.ru:8091' export type ResponseData = { error?: string @@ -7,12 +7,11 @@ export type ResponseData = { } type HeaderType = HeadersInit & { - authorization: string + authorization?: string } const DEFAULT_HEADERS: HeaderType = { 'content-type': 'application/json', - authorization: '', } export interface NetworkApi { @@ -48,7 +47,7 @@ class Network implements NetworkApi { if (value) { this._headers.authorization = `Bearer ${value}` } else { - this._headers.authorization = '' + this._headers.authorization = undefined } this._token = value } diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 9f46470..05fa40b 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ port: 5173, proxy: { '/dev_api': { - target: 'http://127.0.0.1:8090', + target: 'http://localhost:8091', changeOrigin: true, secure: false, rewrite: path => path.replace(/^\/dev_api/, ''), @@ -23,7 +23,7 @@ export default defineConfig({ req.method, req.url, '→', - 'http://127.0.0.1:8090' + req?.url?.replace('/dev_api', '') + 'http://localhost:8091' + req?.url?.replace('/dev_api', '') ) }) },