httpListener
Starting point of every Marble.js application. It includes definitions of all middlewares and API effects.

import { httpListener } from '@marblejs/http';

httpListener :: HttpListenerConfig -> Reader<Context, HttpListener>

parameter
definition
config
HttpListenerConfig

parameter
definition
effects
<optional> Array<RouteEffect | RouteEffectGroup>
middlewares
<optional> Array<HttpMiddlewareEffect>
error$
<optional> HttpErrorEffect
output$
<optional> HttpOutputEffect

Reader<Context, HttpListener>

http.listener
import { httpListener } from '@marblejs/http';
import { bodyParser$ } from '@marblejs/middleware-body';
import { logger$ } from '@marblejs/middleware-logger';
import { api$ } from './api';
const middlewares = [
logger$(),
bodyParser$(),
];
const effects = [
api$,
];
export const listener = httpListener({ middlewares, effects });
Copy link
On this page
Importing
Type declaration
Parameters
Returns
Example