mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-05-15 03:25:40 +08:00
30 lines
736 B
TypeScript
30 lines
736 B
TypeScript
import {defineEventHandler, getRequestURL} from 'h3'
|
|
import {requireUserSession} from '../utils/auth'
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const url = getRequestURL(event)
|
|
if (!url.pathname.startsWith('/api/')) {
|
|
return
|
|
}
|
|
if (url.pathname.startsWith('/api/atc/say')) {
|
|
return
|
|
}
|
|
if (url.pathname.startsWith('/api/service/')) {
|
|
return
|
|
}
|
|
if (url.pathname.startsWith('/api/bridge/')) {
|
|
return
|
|
}
|
|
if (url.pathname.startsWith('/api/copilot/')) {
|
|
return
|
|
}
|
|
if (url.pathname === '/api/decision-flows/runtime') {
|
|
return
|
|
}
|
|
if (event.node.req.method === 'OPTIONS') {
|
|
return
|
|
}
|
|
await requireUserSession(event)
|
|
})
|
|
|