test persistent directory
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -3,6 +3,17 @@ import type { PageServerLoad } from '../anmeldung/$types';
|
|||||||
|
|
||||||
import { ROUTE_NAMES } from '..';
|
import { ROUTE_NAMES } from '..';
|
||||||
|
|
||||||
|
import fs from 'fs';
|
||||||
|
const path = '/daten';
|
||||||
|
|
||||||
|
fs.access(path, fs.constants.F_OK, (err) => {
|
||||||
|
if (err) {
|
||||||
|
console.error(`❌ Directory "${path}" does NOT exist or is not accessible.`);
|
||||||
|
} else {
|
||||||
|
console.log(`✅ Directory "${path}" exists and is accessible.`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export const load: PageServerLoad = (event: ServerLoadEvent) => {
|
export const load: PageServerLoad = (event: ServerLoadEvent) => {
|
||||||
if (!event.locals.user && event.url.pathname !== ROUTE_NAMES.ANMELDUNG)
|
if (!event.locals.user && event.url.pathname !== ROUTE_NAMES.ANMELDUNG)
|
||||||
throw redirect(303, ROUTE_NAMES.ANMELDUNG);
|
throw redirect(303, ROUTE_NAMES.ANMELDUNG);
|
||||||
|
|||||||
Reference in New Issue
Block a user