feat(material): create model interface of material

This commit is contained in:
riefive
2025-09-18 13:19:15 +07:00
parent 9ce5038e62
commit 117e72fdce
3 changed files with 24 additions and 4 deletions
+6 -1
View File
@@ -7,9 +7,12 @@ 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 pathname = url.pathname.replace(/^\/api/, '')
const targetUrl = API_ORIGIN + pathname + (url.search || '')
const targetUrl = apiOrigin + pathname + (url.search || '')
const verificationId = headers['verification-id'] as string | undefined
let bearer = ''
@@ -35,6 +38,8 @@ export default defineEventHandler(async (event) => {
}
}
console.log(targetUrl)
const res = await fetch(targetUrl, {
method,
headers: forwardHeaders,