diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..76819a8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx +COPY dist/ /usr/share/nginx/html/ +COPY nginx/default.conf /etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..790cda0 --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,17 @@ +server { + listen 80; + server_name localhost; + + access_log /var/log/nginx/host.access.log main; + error_log /var/log/nginx/error.log error; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file diff --git a/src/axios/fetch.js b/src/axios/fetch.js index b0e9cd1..3f0194f 100644 --- a/src/axios/fetch.js +++ b/src/axios/fetch.js @@ -1,13 +1,13 @@ import axios from 'axios' export const api = axios.create({ - // baseURL: 'https://ccb.canary.moe/api/', - baseURL: window.location.origin + '/api/', + baseURL: 'https://ccb.canary.moe/api/', + // baseURL: 'https://api.lacus.site/ccb/', // baseURL: 'http://152.136.99.231:8001' + '/api/', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - 'Accept': 'application/json' - // 'Access-Control-Allow-Origin': '*' + 'Accept': 'application/json', + 'Access-Control-Allow-Origin': '*' }, timeout: 10 * 1000 })