chore: update nuxt config
This commit is contained in:
@@ -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,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, {
|
||||
|
||||
Reference in New Issue
Block a user