Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
/** @type {import('@sveltejs/kit').Handle} */ | |
import { symlink } from 'fs'; | |
import { resolve as pathResolve } from 'path'; | |
import { env } from '$env/dynamic/public'; | |
export async function handle({ event, resolve }) { | |
// create symlink to static folder | |
const staticPath = pathResolve(env.PUBLIC_FILE_UPLOAD_DIR as string); | |
const staticTarget = pathResolve('./build/static'); | |
symlink(staticPath, staticTarget, (err) => { | |
if (err) { | |
console.error(err); | |
} | |
}); | |
const response = await resolve(event); | |
return response; | |
} |