summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/.dockerignore1
-rw-r--r--frontend/nginx.conf17
-rw-r--r--frontend/src/api/routes/token-signin.js10
-rw-r--r--frontend/src/api/socket.js6
4 files changed, 10 insertions, 24 deletions
diff --git a/frontend/.dockerignore b/frontend/.dockerignore
new file mode 100644
index 00000000..3c3629e6
--- /dev/null
+++ b/frontend/.dockerignore
@@ -0,0 +1 @@
+node_modules
diff --git a/frontend/nginx.conf b/frontend/nginx.conf
index ed7e5cfe..1b4e3a73 100644
--- a/frontend/nginx.conf
+++ b/frontend/nginx.conf
@@ -8,23 +8,6 @@ server {
try_files $uri $uri/ /index.html;
}
- location /socket.io {
- proxy_http_version 1.1;
-
- proxy_buffering off;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "Upgrade";
- proxy_pass http://api:8081/socket.io;
- }
-
- location /tokensignin {
- proxy_pass http://api:8081/tokensignin;
- }
-
- location /api {
- proxy_pass http://api:8081/api;
- }
-
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
diff --git a/frontend/src/api/routes/token-signin.js b/frontend/src/api/routes/token-signin.js
index 577f4723..d6cff570 100644
--- a/frontend/src/api/routes/token-signin.js
+++ b/frontend/src/api/routes/token-signin.js
@@ -1,10 +1,10 @@
export function performTokenSignIn(token) {
const apiUrl = process.env.REACT_APP_API_BASE_URL || ''
- const data = new FormData()
- data.append('idtoken', token)
- return fetch(`https://${apiUrl}/tokensignin`, {
+ return fetch(`${apiUrl}/tokensignin`, {
method: 'POST',
- body: data,
- })
+ body: new URLSearchParams({
+ idtoken: token,
+ }),
+ }).then((res) => res.json())
}
diff --git a/frontend/src/api/socket.js b/frontend/src/api/socket.js
index 6974d5eb..1c432167 100644
--- a/frontend/src/api/socket.js
+++ b/frontend/src/api/socket.js
@@ -6,9 +6,11 @@ let requestIdCounter = 0
const callbacks = {}
export function setupSocketConnection(onConnect) {
- const apiUrl = process.env.REACT_APP_API_BASE_URL || window.location.hostname + ':' + window.location.port
+ const apiUrl =
+ process.env.REACT_APP_API_BASE_URL ||
+ `${window.location.protocol}//${window.location.hostname}:${window.location.port}`
- socket = io.connect(window.location.protocol + '//' + apiUrl)
+ socket = io.connect(apiUrl)
socket.on('connect', onConnect)
socket.on('response', onSocketResponse)
}