是否可以从 Grunt 任务中启动 MongoDB?基本上,当我使用 grunt server
运行我的开发环境时,我希望它也可以通过运行 mongod
来启动 MongoDB 服务器。
最佳答案
您可以使用 grunt-shell-spawn去做这个。上一个答案推荐grunt-shell,它在主进程上同步运行——阻塞其他任务的执行。
shell: {
mongo: {
command: 'mongod',
options: {
async: true
}
}
}
关于mongodb - 从 Grunt 任务中启动 MongoDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17871833/