Routing
Routing determines how an application responds to a client request to a particular endpoint, which is a path and a specific HTTP method (eg. GET, POST).
Route composition
import { combineRoutes, r } from '@marblejs/http';
const getUsers$ = r.pipe(
r.matchPath('/'),
r.matchType('GET'),
r.useEffect(req$ => req$.pipe(
// ...
)));
const postUser$ = r.pipe(
r.matchPath('/'),
r.matchType('POST'),
r.useEffect(req$ => req$.pipe(
// ...
)));
export const user$ = combineRoutes('/user', [
getUsers$,
postUser$,
]);Body parameters
URL parameters
Query parameters
Last updated