Wednesday 25 September 2019

javascript - Correct way of starting mongodb and express?

If you are running on Linux you could use the package.json file to define scripts which do just what you need.



There are a few issues altho :



If you are running Linux you could use



"mongod --fork --dbpath data --config mongo.conf" and "node index.js" to use mongodb and run the app at the same time and that would work just fine.



But if you are on windows you have to use a separate console window for mongo and a separate one for the app.




If you are running on Windows I would probably use my package.json scripts to run mongodb and I would run my app in another terminal since it's easier to type node index.js than the mongod part.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...