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', '') ) }) },