Start MongoDB from within a Grunt task

前端 未结 3 891
囚心锁ツ
囚心锁ツ 2020-12-30 00:12

Is it possible to start MongoDB from within a Grunt task? Basically when I\'m running my development environment with grunt server I want it to start up the Mo

3条回答
  •  春和景丽
    2020-12-30 00:36

    You can use grunt-shell-spawn to do this. The previous answer recommends grunt-shell, which runs synchronously on the main process - blocking execution of other tasks.

    shell: {
        mongo: {
            command: 'mongod',
            options: {
                async: true
            }
        }
    }
    

提交回复
热议问题