# Middleware implementation and editor

**URL:** https://discourse.nodered.org/t/middleware-implementation-and-editor/30248
**Category:** General
**Created:** [17 July 2020 06:28 UTC](https://discourse.nodered.org/t/middleware-implementation-and-editor/30248 "2020-07-17T06:28:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![cris\_ramil](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cris\_ramil](https://discourse.nodered.org/u/cris_ramil)
#### Post date: [17 July 2020 06:28 UTC](https://discourse.nodered.org/t/middleware-implementation-and-editor/30248/1 "2020-07-17T06:28:09Z")

</div>

Hello guys can someone help me. I've tried embedding node-red in a js app but whenever I use my customized middleware to access the node-red editor I've been having problems on deploying changes. Why is that so!

---

<div class="post-metadata">

### Author: ![cris\_ramil](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cris\_ramil](https://discourse.nodered.org/u/cris_ramil)
#### Post date: [17 July 2020 10:53 UTC](https://discourse.nodered.org/t/middleware-implementation-and-editor/30248/2 "2020-07-17T10:53:42Z")

</div>

This are the events not recorded when the middleware is implemented.

17 Jul 18:26:25 - [audit] {"event":"comms.close","user":null,"session":"ElqnETghlcQ93BKCNEAITlD9oiaP8U3C","level":98,"timestamp":1594981585222}  
17 Jul 18:26:26 - [audit] {"event":"nodes.list.get","level":98,"path":"/nodes","ip":"::ffff:192.168.8.105","timestamp":1594981586110}  
17 Jul 18:26:26 - [audit] {"event":"nodes.icons.get","level":98,"path":"/icons","ip":"::ffff:192.168.8.105","timestamp":1594981586391}  
17 Jul 18:26:26 - [audit] {"event":"nodes.configs.get","level":98,"path":"/nodes","ip":"::ffff:192.168.8.105","timestamp":1594981586421}

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [17 July 2020 11:03 UTC](https://discourse.nodered.org/t/middleware-implementation-and-editor/30248/3 "2020-07-17T11:03:32Z")

</div>

> [@cris\_ramil](#):
>
> I've been having problems on deploying changes. Why is that so!

Hi @cris_ramil

without any information on what you've done, or what problems you are having, it is impossible to provide any help. What custom middleware are you using? How have you embedded Node-RED in your app exactly?

> [@cris\_ramil](#):
>
> This are the events not recorded when the middleware is implemented.

Can you explain what you mean by that?

---

<div class="post-metadata">

### Author: ![cris\_ramil](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cris\_ramil](https://discourse.nodered.org/u/cris_ramil)
#### Post date: [17 July 2020 11:12 UTC](https://discourse.nodered.org/t/middleware-implementation-and-editor/30248/4 "2020-07-17T11:12:09Z")

</div>

I've embedded node-red through this  
middleware and dashboard is working. The editor is shown but i cant edit it or deploy changes.  
app.use(settings.httpAdminRoot,ensureAuthenticated, ensureUser,RED.httpAdmin);  
app.use(settings.httpNodeRoot,ensureAuthenticated,ensureUser,RED.httpNode);

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [17 July 2020 11:17 UTC](https://discourse.nodered.org/t/middleware-implementation-and-editor/30248/5 "2020-07-17T11:17:04Z")

</div>

> [@cris\_ramil](#):
>
> The editor is shown but i cant edit it or deploy changes.

So what have you done to debug it? Are there any errors in the browser when you click the deploy button?

We have no idea what your `ensureAuthenticated` and `ensureUser` middleware are doing - you need to debug those to see why they are breaking the requests.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [15 September 2020 11:26 UTC](https://discourse.nodered.org/t/middleware-implementation-and-editor/30248/6 "2020-09-15T11:26:39Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
