Skip to content

Commit

Permalink
Fix: Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianKoerner committed Jun 15, 2024
1 parent 07f564d commit 54e0476
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/handler/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { FastifyReply, FastifyRequest } from 'fastify';
import type { Core } from '../types.js';
import { config } from '../config.js';
import { toJpeg, toPng } from '@dicebear/converter';
import { createRequire } from 'node:module';

export type AvatarRequest = {
Params: {
Expand All @@ -13,12 +12,14 @@ export type AvatarRequest = {
};

export function avatarHandler(core: Core, style: any) {
const require = createRequire(import.meta.url);
const interRegular = new URL(
'../fonts/inter/inter-regular.otf',
import.meta.url
);

const fonts = [
require.resolve('../fonts/inter/inter-regular.otf'),
require.resolve('../fonts/inter/inter-bold.otf'),
];
const interBold = new URL('../fonts/inter/inter-bold.otf', import.meta.url);

const fonts = [interRegular.pathname, interBold.pathname];

return async (
request: FastifyRequest<AvatarRequest>,
Expand Down

0 comments on commit 54e0476

Please sign in to comment.