initial commit
This commit is contained in:
15
server/api/live/debug-request-host.get.js
Normal file
15
server/api/live/debug-request-host.get.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { getRequestHost, getRequestURL } from 'h3'
|
||||
import { requireAuth } from '../../utils/authHelpers.js'
|
||||
|
||||
/**
|
||||
* Diagnostic: returns the host the server sees for this request.
|
||||
* Use from the phone or laptop to verify the server receives the expected hostname (e.g. LAN IP).
|
||||
* Auth required.
|
||||
*/
|
||||
export default defineEventHandler((event) => {
|
||||
requireAuth(event)
|
||||
return {
|
||||
host: getRequestHost(event),
|
||||
hostname: getRequestURL(event).hostname,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user