First of all apologies if i couldnt explain my question but i will try my best.
I am building an app which dynamically creates node APIs for users also run them and return url of that API.So, i want to run node server for every Project dynamically.Right now i am using Nodemon which will run a script like this:
const express = require('express');
const app = express();
app.use('/projectone',require('./projects/projectone/server.js'));
app.use('/projecttwo',require('./projects/projecttwo/server.js'));
app.listen(3000);
Every new project will add project's link in this script and nodemon will restart automatically.but this is not a good approach as it is restarting all the projects on adding or updating one project.So i want to run separate nodemon or node instance for each project.
Added details
i am using this at my local machine.as it is under development.so when i create new project ,the project generation code adds a project folder with files in projects folder.this change triggers nodemon which restarts and start watching newly added project.
Any suggestion for this will be appreciated.