I am trying to create two contact forms on my website using Node.js, and each one requires its own package.json file. I've tried installing the necessary packages so that a package.json file will be created for the second time, but it's not working. It seems I cannot create two in one folder.
Does anyone know what I can do to create a new package.json file for this new contact form in the same folder?
Thank you!
If you want to have 2 different applications within one single project, you should have to entry points (I think it would be Server.js and Server2.js).
Then you want to run two different instances of the same project: one starting Server.js and another one starting Server2.js. You can do it with two different scripts in the package.json. Example:
// package.json
...
"scripts": {
"start:1": "node Server.js",
"start:2": "node Server2.js"
}
...
And you can start them with:
$ npm run start:1
$ npm run start:2
Notice that if both applications run on the same machine, they should run on different ports.