Spaces:
Running
Running
⚡ add base path deepsite
Browse files- hooks/useAi.ts +2 -2
- lib/api.ts +1 -1
- next.config.ts +11 -0
hooks/useAi.ts
CHANGED
|
@@ -163,7 +163,7 @@ export const useAi = (onScrollToBottom?: () => void) => {
|
|
| 163 |
setController(abortController);
|
| 164 |
|
| 165 |
try {
|
| 166 |
-
const request = await fetch("/api/ask", {
|
| 167 |
method: "POST",
|
| 168 |
body: JSON.stringify({
|
| 169 |
prompt,
|
|
@@ -287,7 +287,7 @@ export const useAi = (onScrollToBottom?: () => void) => {
|
|
| 287 |
? pages.filter(page => page.path === contextFile)
|
| 288 |
: pages;
|
| 289 |
|
| 290 |
-
const request = await fetch("/api/ask", {
|
| 291 |
method: "PUT",
|
| 292 |
body: JSON.stringify({
|
| 293 |
prompt,
|
|
|
|
| 163 |
setController(abortController);
|
| 164 |
|
| 165 |
try {
|
| 166 |
+
const request = await fetch("/deepsite/api/ask", {
|
| 167 |
method: "POST",
|
| 168 |
body: JSON.stringify({
|
| 169 |
prompt,
|
|
|
|
| 287 |
? pages.filter(page => page.path === contextFile)
|
| 288 |
: pages;
|
| 289 |
|
| 290 |
+
const request = await fetch("/deepsite/api/ask", {
|
| 291 |
method: "PUT",
|
| 292 |
body: JSON.stringify({
|
| 293 |
prompt,
|
lib/api.ts
CHANGED
|
@@ -2,7 +2,7 @@ import axios from "axios";
|
|
| 2 |
import MY_TOKEN_KEY from "./get-cookie-name";
|
| 3 |
|
| 4 |
export const api = axios.create({
|
| 5 |
-
baseURL: `/api`,
|
| 6 |
headers: {
|
| 7 |
cache: "no-store",
|
| 8 |
},
|
|
|
|
| 2 |
import MY_TOKEN_KEY from "./get-cookie-name";
|
| 3 |
|
| 4 |
export const api = axios.create({
|
| 5 |
+
baseURL: `/deepsite/api`,
|
| 6 |
headers: {
|
| 7 |
cache: "no-store",
|
| 8 |
},
|
next.config.ts
CHANGED
|
@@ -2,6 +2,17 @@ import type { NextConfig } from "next";
|
|
| 2 |
|
| 3 |
const nextConfig: NextConfig = {
|
| 4 |
/* config options here */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
webpack(config, options) {
|
| 6 |
const { isServer } = options;
|
| 7 |
config.module.rules.push({
|
|
|
|
| 2 |
|
| 3 |
const nextConfig: NextConfig = {
|
| 4 |
/* config options here */
|
| 5 |
+
basePath: '/deepsite',
|
| 6 |
+
async redirects() {
|
| 7 |
+
return [
|
| 8 |
+
{
|
| 9 |
+
source: '/',
|
| 10 |
+
destination: '/deepsite',
|
| 11 |
+
permanent: true,
|
| 12 |
+
basePath: false,
|
| 13 |
+
},
|
| 14 |
+
];
|
| 15 |
+
},
|
| 16 |
webpack(config, options) {
|
| 17 |
const { isServer } = options;
|
| 18 |
config.module.rules.push({
|