Directus Page API Endpoints

Hello guys!

Ive been doing some tests with ur sandbox and find the Pages Structure very pleasing!
Although the endpoints have been bugging me for a while page/1 page/2

My question is if is possible to have a unique field or slug that i can do and use page/[title or slug] to get the correct page without the integer logic!

export const getPage = (__collection, __lang = 'en-US') => {
    return directus.request(
       readItems(__collection, {
          fields: [
               '*.item.*.*',
          ],
       })
    );
}

Take a look at our Astro example here. Instead of doing a ‘get by id’, you would query your pages collection for items where slug = the current url.

This should return an array with a single item. or if the array is empty, then you return a 404.