# My first module, config does not update until NodeRED is restarted

**URL:** <https://discourse.nodered.org/t/my-first-module-config-does-not-update-until-nodered-is-restarted/78581>\
**Category:** Developing Nodes\
**Created:** [21 May 2023 15:13 UTC](https://discourse.nodered.org/t/my-first-module-config-does-not-update-until-nodered-is-restarted/78581 "2023-05-21T15:13:10Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![cmtickle](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cmtickle/32/79970_2.png) [@cmtickle](https://discourse.nodered.org/u/cmtickle)\
**Post date:** [30 May 2023 22:05 UTC](https://discourse.nodered.org/t/my-first-module-config-does-not-update-until-nodered-is-restarted/78581/11 "2023-05-30T22:05:21Z")

</div>

Thanks again @TotallyInformation for your assistance.

In the end, with a bit of luck and some more persistence I managed to find out the issue. Posting here in case anyone has the same issue and possibly so I can be warned that this is a bad idea and there's a better way.

In my code, I am listening on various URLs, binding as below:

```auto
RED.httpNode.get('/etc/:area?/:filetype.xml', function(req, res) {

```

This code only gets called once (at the point when NodeRED starts up) therefore the config values are from when the restart of NodeRED happens.

I fixed this (with the help of ChatGPT) by closing the HTTP connection as below whenever the flow is deployed.

```auto
node.on('close', function(removed, done) {
    RED.httpNode._router.stack.forEach(function(route, i, routes) {
        if (route.route && route.route.path === '/etc/:area?/:filetype.xml') {
            routes.splice(i, 1);
        }
    });
    done();
}

```

My config values are now updated when the flow restarts, as was my original goal.

---

_[View the full topic](https://discourse.nodered.org/t/my-first-module-config-does-not-update-until-nodered-is-restarted/78581)._
