'Get params URL with Sveltekit endpoint

I'm trying to get the params in my URL for an API endpoints I coded with SvelteKit.

I wanted to use the stores for that:

import {page } from '$app/stores';

and then, in my GET endpoint:

export async function get({ request, params }) {
    const path = params.auth;
    console.log($page.URL);
…

Svelte gives me an error with: $page is not defined

Did I miss something?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source