Skip to content

Commit

Permalink
Serve icons
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Jan 3, 2025
1 parent 1f6c1a0 commit 8f16813
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pages/icons/[...rest]/index.svg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { APIRoute } from 'astro';
import { getSvgFile } from '~/components/Svg/utils';

export const GET: APIRoute = async ({ params }) => {
const html = getSvgFile(`icons/${params.rest}`);
return new Response(html, { headers: { 'content-type': 'image/svg+xml' } });
};
7 changes: 7 additions & 0 deletions src/pages/svg/[...rest]/index.svg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { APIRoute } from 'astro';
import { getSvgFile } from '~/components/Svg/utils';

export const GET: APIRoute = async ({ params }) => {
const html = getSvgFile(`svg/${params.rest}`);
return new Response(html, { headers: { 'content-type': 'image/svg+xml' } });
};

0 comments on commit 8f16813

Please sign in to comment.