简体   繁体   中英

start 2 server using npm start

Is it possible to start 2 different server using npm start:

package.json:

"scripts": {
    "start": "node index && http-server ./"
}

I wan to start a node app and a http-server to serve Single Page App.


Thanks @Lazyexpert for the answer, just use single & .

Sure, why not. The start script itself is just a command line command. You can push there whatever works as a command in command line.

Also you might would like to look at npm package concurrently .

Using this package, you start script will look like this:

"start": "concurrently \"command1 arg\" \"command2 arg\""

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