Multiple http in URL nodes

Hello
I'm trying to have different URL endpoints for handling POST requests to NODE-RED and found that only first one is working.
Is there any way to build this with core http in node?
Thank in advance

[
    {
        "id": "9ec65404.c89f68",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": ""
    },
    {
        "id": "7248c2d1.7530ac",
        "type": "debug",
        "z": "9ec65404.c89f68",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "x": 810,
        "y": 260,
        "wires": []
    },
    {
        "id": "46e41555.8f079c",
        "type": "http in",
        "z": "9ec65404.c89f68",
        "name": "Packages",
        "url": "/packages",
        "method": "post",
        "upload": false,
        "swaggerDoc": "",
        "x": 200,
        "y": 300,
        "wires": [
            [
                "7248c2d1.7530ac",
                "f3b3bafe.6d3438"
            ]
        ]
    },
    {
        "id": "862fa9ad.734498",
        "type": "http in",
        "z": "9ec65404.c89f68",
        "name": "Projects",
        "url": "/projects",
        "method": "post",
        "upload": false,
        "swaggerDoc": "",
        "x": 200,
        "y": 180,
        "wires": [
            [
                "7248c2d1.7530ac",
                "f3b3bafe.6d3438"
            ]
        ]
    },
    {
        "id": "f3b3bafe.6d3438",
        "type": "http response",
        "z": "9ec65404.c89f68",
        "name": "",
        "statusCode": "200",
        "headers": {
            "content-type": "text/plain",
            "Welcome": "to the demo"
        },
        "x": 520,
        "y": 400,
        "wires": []
    }
]

I think the issue will be your /projects endpoint is clashing with the admin api end point of the same name.

If you want to use that as an end point, you'll need to set httpAdminRoot in your settings file to move the Node-RED editor (and its admin api) away from /. For example, set it to /admin

2 Likes

Thank you so much!!! It works with moved to /admin