feat(material): retest material

This commit is contained in:
riefive
2025-09-19 16:08:42 +07:00
parent 70378a69e9
commit 8aa6d3b6f8
4 changed files with 30 additions and 23 deletions
+1 -3
View File
@@ -1,15 +1,13 @@
import process from 'node:process'
import { defineEventHandler, getCookie, getRequestHeaders, getRequestURL, readBody } from 'h3'
const API_ORIGIN = process.env.API_ORIGIN as string
export default defineEventHandler(async (event) => {
const { method } = event.node.req
const headers = getRequestHeaders(event)
const url = getRequestURL(event)
const config = useRuntimeConfig()
const apiOrigin = config.API_ORIGIN || API_ORIGIN
const apiOrigin = config.API_ORIGIN
const pathname = url.pathname.replace(/^\/api/, '')
const targetUrl = apiOrigin + pathname + (url.search || '')