data is class member of Wall, Guard , Shield and Controller. It is used to transfer data from one component to another and finally to worker.

e.g - Let's see how we can pass data from wall to controller -


import { Wall, textResult } from "fortjs";
export class RequestLogger extends Wall {

    private getIP(req) {
        var ip = (req.headers['x-forwarded-for'] || '').split(',').pop() ||
            req.connection.remoteAddress ||
            req.socket.remoteAddress ||
        return ip;

    async onIncoming() {
        // here we are sending ip to other components = this.getIP(this.request);

        return null;

The above wall is using data to pass ip to other components.

Access ip address passded from Wall in Controller

import { Controller, textResult, DefaultWorker } from "fortjs";

export class DefaultController extends Controller {

    async default() {
        // access ip 
        const ip =;
        return textResult(`Ip is ${ip}`);