правка порта

main
Пилипенко Андрей Борисович 1 month ago
parent 6ac828e2cf
commit 84da23519c

@ -82,7 +82,7 @@ This example uses the Web Server Gateway Interface (WSGI) with Django to enable
```bash ```bash
python manage.py collectstatic python manage.py collectstatic
python manage.py runserver 8090 python manage.py runserver 8091
docker rmi -f <image_id> docker rmi -f <image_id>
docker compose down && docker compose build --no-cache && docker compose up 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/<container_id>/<container_id>-json.log less +G /var/lib/docker/containers/<container_id>/<container_id>-json.log
``` ```
Your Django application is now available at `http://localhost:8090`. Your Django application is now available at `http://localhost:8091`.

@ -2,7 +2,7 @@ import unittest
import requests import requests
import uuid import uuid
BASE_URL = "http://localhost:8090" BASE_URL = "http://localhost:8091"
def get_error_message(response: requests.Response) -> str: def get_error_message(response: requests.Response) -> str:

@ -23,5 +23,8 @@ export default defineConfig([
ecmaVersion: 2020, ecmaVersion: 2020,
globals: globals.browser, globals: globals.browser,
}, },
rules: {
'@typescript-eslint/no-unused-vars': 'warn',
},
}, },
]) ])

@ -5,6 +5,7 @@
"description": "Game Shop", "description": "Game Shop",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "vite",
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"lint": "eslint .", "lint": "eslint .",

@ -1,5 +1,5 @@
const DEV_URL = '/dev_api' const DEV_URL = '/dev_api'
const PROD_URL = 'https://shop.softwarrior.ru:8090' const PROD_URL = 'https://shop.softwarrior.ru:8091'
export type ResponseData = { export type ResponseData = {
error?: string error?: string
@ -7,12 +7,11 @@ export type ResponseData = {
} }
type HeaderType = HeadersInit & { type HeaderType = HeadersInit & {
authorization: string authorization?: string
} }
const DEFAULT_HEADERS: HeaderType = { const DEFAULT_HEADERS: HeaderType = {
'content-type': 'application/json', 'content-type': 'application/json',
authorization: '',
} }
export interface NetworkApi { export interface NetworkApi {
@ -48,7 +47,7 @@ class Network implements NetworkApi {
if (value) { if (value) {
this._headers.authorization = `Bearer ${value}` this._headers.authorization = `Bearer ${value}`
} else { } else {
this._headers.authorization = '' this._headers.authorization = undefined
} }
this._token = value this._token = value
} }

@ -8,7 +8,7 @@ export default defineConfig({
port: 5173, port: 5173,
proxy: { proxy: {
'/dev_api': { '/dev_api': {
target: 'http://127.0.0.1:8090', target: 'http://localhost:8091',
changeOrigin: true, changeOrigin: true,
secure: false, secure: false,
rewrite: path => path.replace(/^\/dev_api/, ''), rewrite: path => path.replace(/^\/dev_api/, ''),
@ -23,7 +23,7 @@ export default defineConfig({
req.method, req.method,
req.url, req.url,
'→', '→',
'http://127.0.0.1:8090' + req?.url?.replace('/dev_api', '') 'http://localhost:8091' + req?.url?.replace('/dev_api', '')
) )
}) })
}, },

Loading…
Cancel
Save