add gpt/chat api prefix (#33)

* add gpt/chat api prefix

* add chatgpt backend url
This commit is contained in:
Dmitry Afanasyev
2023-10-11 14:21:50 +03:00
committed by GitHub
parent 7cd0f30c55
commit 9e3fac0b94
14 changed files with 142 additions and 110 deletions

View File

@@ -112,7 +112,7 @@ const ask_gpt = async (message) => {
await new Promise((r) => setTimeout(r, 1000));
window.scrollTo(0, 0);
const response = await fetch(`/backend-api/v2/conversation`, {
const response = await fetch(`{{api_path}}/backend-api/v2/conversation`, {
method: `POST`,
signal: window.controller.signal,
headers: {
@@ -151,7 +151,7 @@ const ask_gpt = async (message) => {
if (
chunk.includes(
`<form id="challenge-form" action="/backend-api/v2/conversation?`
`<form id="challenge-form" action="{{api_path}}/backend-api/v2/conversation?`
)
) {
chunk = `cloudflare token expired, please refresh the page.`;