I have a express app for providing backend restful API.
index.js
const express = require('express')
const app = express()
// add
app.get('/hello', (req, res) => {
// logic steps
let a = 'hello,'
let b = 'world!'
let c = a + b
res.send(c)
})
app.get('/foo', (req, res) => {
// logic steps
let data = handlerFoo(req)
res.send(c)
})
app.get('/bar', (req, res) => {
// logic steps
let data = handlerBar(req)
res.send(data)
})
function handlerFoo(req) {
// ...
}
function handlerBar(req) {
// ....
}
app.listen(3000, () => {
console.log(`Example app listening on port 3000}`)
})
is it possible to use node-red
to edit the handler function? I mean use node-red to write the logic steps for all handlers, the handlerFoo
, handlerBar
implements by node-RED
.