Integration tests for API #53

Merged
vbrandl merged 5 commits from testing into main 2024-08-18 15:48:52 +02:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit da92ed6258 - Show all commits

View File

@ -1,9 +1,7 @@
import { log, timedExecution } from '$lib';
import { log, timedExecution, requestIdHeader } from '$lib';
import { validate, v7 as uuidv7 } from 'uuid';
import type { Handle } from '@sveltejs/kit';
const requestIdHeader = 'x-request-id';
export const handle: Handle = async ({ event, resolve }) => {
// use incoming requestId, if it is a valid uuid, else generate one
const reqIdFromRequest = event.request.headers.get(requestIdHeader);

View File

@ -29,6 +29,8 @@ if (!('STORAGE_PATH' in process.env)) {
}
export const storagePath: string = process.env.STORAGE_PATH ?? defaultPath;
export const requestIdHeader = 'x-request-id';
export default safePath;
export async function timedExecution<T>(