Currently when developing locally I run my MongoDB and start Nodemon. I do this in vscode terminals but I never remember the commands so I have a txt file that I copy/paste from every time. I was wondering if it's possible to set a script in my package.json that I could call to run these for me.
I've tried to use the answer from how to execute powershell ps1 scripts from package.json "scripts"? as an example but since I'm not able to figure it out. The two things I'm currently doing are:
To start MongoDB
& 'C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe'
To start Nodemon. I also set the node_env to development here
$env:NODE_ENV="development"
nodemon server/server.js
I've been doing it the current way for months, so it isn't that big of a deal. I'm just wondering if there is an easier way to start these up without copy/pasting the commands.
mongodprocess with each application start ( and especially restart ). Instead it's far more sane to simply spawn this process ( preferably in a background process ) once, and possibly preferably on your computer startup as a service. Unless you really have some need for "multiple instances" ( and I don't see any--dpbathor--portoptions, so you likely do not ) then that's what you should be doing. Consult the documentation on installing as a Windows Service instead.