Answer the question
In order to leave comments, you need to log in
How to run json-server and React/vue at the same time by npm start?
Head-on option doesn't work (using VueJS as an example)
"scripts": {
"start": "npm run dev & npm run rest-api",
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
"rest-api": "json-server --watch server/api/db.json"
},
Answer the question
In order to leave comments, you need to log in
First three google links:
1) npm-run-all
package 2) npm-run-parallel
package
3) so question and fourth package ( https://github.com/kimmobrunfeldt/concurrently - I would start with it)
search engine query: npm run parallel scripts
The pm2 module for launching various applications and the ability to create clusters.
It is possible through the command line separately, it is possible simultaneously through the pm2.config.js file:
module.exports = {
apps : [{
name : "worker",
script : "./worker.js",
}, {
name : "api-app",
script : "./api.js",
}]
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question