chore: update nuxt config

This commit is contained in:
riefive
2025-09-24 15:01:52 +07:00
parent 7c452c923a
commit d0b3d28cdd
6 changed files with 8 additions and 20 deletions
+1 -4
View File
@@ -1,4 +1,3 @@
import process from 'node:process'
import { defineEventHandler, getCookie, getRequestHeaders, getRequestURL, readBody } from 'h3'
export default defineEventHandler(async (event) => {
@@ -7,7 +6,7 @@ export default defineEventHandler(async (event) => {
const url = getRequestURL(event)
const config = useRuntimeConfig()
const apiOrigin = config.API_ORIGIN
const apiOrigin = config.public.API_ORIGIN
const pathname = url.pathname.replace(/^\/api/, '')
const targetUrl = apiOrigin + pathname + (url.search || '')
@@ -36,8 +35,6 @@ export default defineEventHandler(async (event) => {
}
}
console.log(targetUrl)
const res = await fetch(targetUrl, {
method,
headers: forwardHeaders,
+1 -3
View File
@@ -1,4 +1,3 @@
import { useRuntimeConfig } from '#imports'
import { getRequestURL, readBody, setCookie } from 'h3'
export default defineEventHandler(async (event) => {
@@ -6,8 +5,7 @@ export default defineEventHandler(async (event) => {
const url = getRequestURL(event)
const config = useRuntimeConfig()
const apiOrigin = config.API_ORIGIN
const apiOrigin = config.public.API_ORIGIN
const externalUrl = apiOrigin + url.pathname.replace(/^\/api/, '') + url.search
const resp = await fetch(externalUrl, {