8 lines
308 B
TypeScript
8 lines
308 B
TypeScript
import { json } from '@sveltejs/kit';
|
|
import { listFolder } from '#lib/server/files';
|
|
import type { RequestHandler } from './$types';
|
|
|
|
export const GET: RequestHandler = async ({ url }) => {
|
|
return json(await listFolder(url.searchParams.get('path') ?? ''), { headers: { 'Cache-Control': 'no-cache' } });
|
|
};
|