简体   繁体   中英

NPM command for mounteback with nodemon

I am using mountebank JS for my mocks and its been a pain to manually restart it. I have installed nodemon in my package.json and been able to run it but it does not restart when I edited and save the ejs files. This is the command I have that runs the mountebank via nodemon:

  "scripts": {
    "start_mb": "mb restart --configfile mocks/imposters.ejs --allowInjection --allowCORS",
    "start_mb_watch": "nodemon --watch mocks/**/*.ejs --exec \"npm run start_mb\"",
  },

Managed to get it working using this

"scripts": {
    "start_mb": "mb restart --configfile mocks/imposters.ejs --allowInjection --allowCORS",
    "start_mb_watch": "nodemon --watch mocks--ext ejs --exec \"npm run start_mb\"",
  },

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM