Browse Source

Merge pull request #309 from ollama-webui/https-fix

fix: api route issue over https
Timothy Jaeryang Baek 1 year ago
parent
commit
46f131cc7c
4 changed files with 4 additions and 4 deletions
  1. 1 1
      backend/dev.sh
  2. 1 1
      backend/start.sh
  3. 1 1
      src/lib/apis/auths/index.ts
  4. 1 1
      src/lib/apis/users/index.ts

+ 1 - 1
backend/dev.sh

@@ -1 +1 @@
-uvicorn main:app --port 8080 --host 0.0.0.0 --reload
+uvicorn main:app --port 8080 --host 0.0.0.0 --forwarded-allow-ips '*' --reload

+ 1 - 1
backend/start.sh

@@ -1 +1 @@
-uvicorn main:app --host 0.0.0.0 --port 8080
+uvicorn main:app --host 0.0.0.0 --port 8080 --forwarded-allow-ips '*'

+ 1 - 1
src/lib/apis/auths/index.ts

@@ -3,7 +3,7 @@ import { WEBUI_API_BASE_URL } from '$lib/constants';
 export const getSessionUser = async (token: string) => {
 	let error = null;
 
-	const res = await fetch(`${WEBUI_API_BASE_URL}/auths`, {
+	const res = await fetch(`${WEBUI_API_BASE_URL}/auths/`, {
 		method: 'GET',
 		headers: {
 			'Content-Type': 'application/json',

+ 1 - 1
src/lib/apis/users/index.ts

@@ -34,7 +34,7 @@ export const updateUserRole = async (token: string, id: string, role: string) =>
 export const getUsers = async (token: string) => {
 	let error = null;
 
-	const res = await fetch(`${WEBUI_API_BASE_URL}/users`, {
+	const res = await fetch(`${WEBUI_API_BASE_URL}/users/`, {
 		method: 'GET',
 		headers: {
 			'Content-Type': 'application/json',