What kind of server? There are too many combinations/permutations of NodeJS server and code structures to be sure it could be automated.
ChatGPT is fairly good with Node-RED, so may be able to at least get your started with the base API structure in place, etc.
There is also the Node-RED function node, which supports NodeJS code, and will run it's contents, but if you're firing up Express endpoints, etc. for example, then best to use the core http-in/http-out nodes.
I think it would help if you explained a little about why you want to do this?
There are alternatives that might work equally well or better in some circumstances and it is likely that your already coded micro-server app is already more efficient than it would be if converted to Node-RED.
Have you considered instead, creating an interface between your server and Node-RED? The specifics of how best to do that depend a lot on what you are trying to achieve - hence the initial question.