lib/makeAPIRoute
Functions
'Read the “', Functions, '” section'apiRoute()
'Read the “', apiRoute(), '” section'function apiRoute(route: string): string
Defined in: studiocms/packages/studiocms/src/lib/makeAPIRoute.ts:39
Creates an API route for the ‘renderer’ service.
This function utilizes the makeAPIRoute
utility to generate
a route specifically for the ‘renderer’ service.
Parameters
'Read the “', Parameters, '” section'string
string
makeAPIRoute()
'Read the “', makeAPIRoute(), '” section'function makeAPIRoute(path: string): (route: string) => string
Defined in: studiocms/packages/studiocms/src/lib/makeAPIRoute.ts:15
Creates a function that generates API route strings.
Parameters
'Read the “', Parameters, '” section'string
The base path for the API route.
Function
A function that takes a route string and returns the full API route.
Parameters
'Read the “', Parameters, '” section'string
string
const apiRoute = makeAPIRoute('users');const fullRoute = apiRoute('profile'); // Returns '/studiocms_api/users/profile'
restRoute()
'Read the “', restRoute(), '” section'function restRoute(version: "v1"): (route: string) => string
Defined in: studiocms/packages/studiocms/src/lib/makeAPIRoute.ts:47
Generates a REST API route string for the specified version.
Parameters
'Read the “', Parameters, '” section'"v1"
The version of the REST API.
Function
The complete API route string for the given version.
Parameters
'Read the “', Parameters, '” section'string
string
sdkRouteResolver()
'Read the “', sdkRouteResolver(), '” section'function sdkRouteResolver(route: string): string
Defined in: studiocms/packages/studiocms/src/lib/makeAPIRoute.ts:29
Resolves the API route for the SDK.
This function uses the makeAPIRoute
utility to generate the API route
specifically for the SDK.
Parameters
'Read the “', Parameters, '” section'string
string
v1RestRoute()
'Read the “', v1RestRoute(), '” section'function v1RestRoute(route: string): string
Defined in: studiocms/packages/studiocms/src/lib/makeAPIRoute.ts:54
Creates a REST API route for version 1.
Parameters
'Read the “', Parameters, '” section'string
string