# Is there a way to read current node config data in RED.httpAdmin.get function?

**URL:** <https://discourse.nodered.org/t/is-there-a-way-to-read-current-node-config-data-in-red-httpadmin-get-function/7820>\
**Category:** General\
**Created:** [11 February 2019 09:06 UTC](https://discourse.nodered.org/t/is-there-a-way-to-read-current-node-config-data-in-red-httpadmin-get-function/7820 "2019-02-11T09:06:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbove73](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbove73/32/5078_2.png) [@gbove73](https://discourse.nodered.org/u/gbove73)\
**Post date:** [11 February 2019 09:06 UTC](https://discourse.nodered.org/t/is-there-a-way-to-read-current-node-config-data-in-red-httpadmin-get-function/7820/1 "2019-02-11T09:06:24Z")

</div>

Hi all,

I'm trying to expose a REST endpoint inside a node.  
I would like to use a node config property inside of it (I don't want to fire the flow).

This is the code:

```
function MyNode(config) {
    RED.nodes.createNode(this, config);
    this.myproperty = config.myproperty;
    node.on('input', function (msg) {
    // ...
        node.send(msg);
    });
}

RED.nodes.registerType("myNode", MyNode);

RED.httpAdmin.get("/myendpoint", function (req, res) {
    // how to read node.myproperty?
});
```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [11 February 2019 10:57 UTC](https://discourse.nodered.org/t/is-there-a-way-to-read-current-node-config-data-in-red-httpadmin-get-function/7820/2 "2019-02-11T10:57:16Z")

</div>

> [@gbove73](#):
>
> I would like to use a node config property inside of it (I don't want to fire the flow)

To get a config property from settings.js, use `RED.settings.<varname>`.

You can't directly access a node instance property since your API is set up outside the registration function - as it should be. If you need a node instance property, add it as a request parameter to the API call. Just don't forget to sanitise any API parameters to prevent security issues.

---

<div class="post-metadata">

**Author:** ![syedhannan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedhannan/32/72932_2.png) [@syedhannan](https://discourse.nodered.org/u/syedhannan)\
**Post date:** [5 January 2023 04:13 UTC](https://discourse.nodered.org/t/is-there-a-way-to-read-current-node-config-data-in-red-httpadmin-get-function/7820/3 "2023-01-05T04:13:39Z")

</div>

Can you please share an example for the same

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 January 2023 11:34 UTC](https://discourse.nodered.org/t/is-there-a-way-to-read-current-node-config-data-in-red-httpadmin-get-function/7820/4 "2023-01-05T11:34:42Z")

</div>

This is an old thread - you would be better off starting a new thread with some details about what you are trying to achieve.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [7 January 2023 08:00 UTC](https://discourse.nodered.org/t/is-there-a-way-to-read-current-node-config-data-in-red-httpadmin-get-function/7820/5 "2023-01-07T08:00:48Z")

</div>

This topic was automatically closed after 44 hours. New replies are no longer allowed.
