Skip to content

crelte / static / CrelteStaticRequest

Type Alias: CrelteStaticRequest ​

ts
type CrelteStaticRequest = CrelteRequest & object;

Type Declaration ​

params ​

ts
params: Map<string, string>;

getParam() ​

ts
getParam(name): string | null;

returns the url params from the request

Parameters ​

name ​

string

Returns ​

string | null

Example ​

js
router.add('/blog/:slug', async csr => {
    const blogData = await fetchBlogData(csr.getParam('slug'));

    return {
        sectionHandle: 'blog',
        typeHandle: 'post',
        ...blogData
    };
});