M
M
Maxim2017-07-25 17:43:34
MongoDB
Maxim, 2017-07-25 17:43:34

How to start mongodb and server automatically?

There is a package.json in it there is such a script

"scripts": {
    "start": "node nodeapi/server.js"
  }

You can somehow add a command to it - mongod. in order not to write it separately in the terminal? Well, or some other methods of starting the database along with the server?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
emp1re, 2017-07-26
@emp1re

MongoDB is a separate service and is not connected to the npm ecosystem, it runs in different ways and even makes separate servers for databases, for example, we run it through doker. The easiest way is to run it manually through the console and keep it forever live.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question