Carbon
Core/Interfaces

Route

Properties

PropertyTypeDescription
disabled?booleanWhether this route is disabled
method"GET" | "POST" | "PATCH" | "DELETE" | "PUT"The HTTP method of the route
path`/${string}`The relative path of the route
protected?booleanWhether this route requires authentication

Methods

handler()

handler(req, ctx?): Response | Promise<Response>

The handler function for the route

Parameters

ParameterTypeDescription
reqRequestThe request object
ctx?ContextThe context object

Returns

Response | Promise<Response>

The response object or a promise that resolves to a response object

On this page