remove strapi and use mdsvex for blog
This commit is contained in:
parent
4673e8dbe6
commit
32fd2642b1
14 changed files with 319 additions and 180 deletions
|
|
@ -1,25 +1,15 @@
|
|||
import { env } from '$env/dynamic/private';
|
||||
import { logger } from '$lib/server/logger';
|
||||
import { Strapi } from '$lib/server/strapi';
|
||||
import type { Handle, HandleServerError } from '@sveltejs/kit';
|
||||
import type { HandleServerError } from '@sveltejs/kit';
|
||||
import { randomUUID } from 'crypto';
|
||||
|
||||
export const handleError: HandleServerError = async ({ error, event, message, status }) => {
|
||||
const errorId = randomUUID();
|
||||
const errorId = randomUUID();
|
||||
|
||||
logger.error({ error, errorId, event, message, status }, 'Blyat');
|
||||
logger.error({ error, errorId, event, message, status }, 'Blyat');
|
||||
|
||||
return {
|
||||
message: 'An Internal Error Occurred',
|
||||
errorId
|
||||
};
|
||||
return {
|
||||
message: 'An Internal Error Occurred',
|
||||
errorId
|
||||
};
|
||||
};
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
event.locals = {
|
||||
strapi: new Strapi(`http://${env.STRAPI_HOST}:${env.STRAPI_PORT}`, env.STRAPI_TOKEN)
|
||||
};
|
||||
|
||||
const response = await resolve(event);
|
||||
return response;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue