Skip to content

Commit

Permalink
Add hello world to client init
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyGuthridge committed Jan 8, 2025
1 parent cd63e6e commit da80b03
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/hooks.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { dev } from '$app/environment';
import api from '$endpoints';
import consts from '$lib/consts';

function helloWorld() {
console.log(`%c${consts.APP_NAME}\n`, 'font-size: 3rem');
console.log(`%cMade with <3 by ${consts.APP_AUTHOR[0]}`, 'font-size: 1.5rem');
console.log(`Check out the code on\n${consts.APP_GITHUB}`);
}

export const init = () => {
helloWorld();
// In dev mode, attach the `endpoints` to the console
if (dev) {
// @ts-expect-error: Global variables are usually an anti-pattern, but this is very useful for
// debugging, and so it is done in dev mode.
globalThis.api = api();
}
}

0 comments on commit da80b03

Please sign in to comment.