eaf925b387
* feat(fe-2): improved logging * yarn lock update * attempted speckle/shared build fix * helm updates * Updates documentation for helm chart --------- Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
16 lines
541 B
TypeScript
16 lines
541 B
TypeScript
import { defineEventHandler, fromNodeMiddleware } from 'h3'
|
|
import { IncomingMessage, ServerResponse } from 'http'
|
|
import { REQUEST_ID_HEADER } from '~~/server/lib/core/helpers/constants'
|
|
|
|
export const DetermineRequestIdMiddleware = (
|
|
req: IncomingMessage,
|
|
res: ServerResponse,
|
|
next: () => void
|
|
) => {
|
|
// we are the ones who are pushing the req.id there, so we know its a string
|
|
res.setHeader(REQUEST_ID_HEADER, `${req.id as string}`)
|
|
next()
|
|
}
|
|
|
|
export default defineEventHandler(fromNodeMiddleware(DetermineRequestIdMiddleware))
|