How to add two consecutive commands for console to json file?
I master node.js and NPM , I have a folder "server" in which the http server and package.json file are installed, and in it there is a folder "webdir" with a web page.
I can start the web server manually, or by specifying the path to it with the node [путь до файла, запускающего сервер]
command node [путь до файла, запускающего сервер]
, but I need this to happen automatically with the npm start
command. And it should be launched from the "webdir" folder so that I can immediately go to my web page at localhost:8080
.
To do this, I need to write two consecutive commands to the console:
1. cd webdir
2. node [path to the file that starts the web server]
What should be the syntax in the json file for the command to enter and execute these two lines in the console?
This is how one-line working code looks like:
"scripts": { "start": "node (...)/node_modules/http-server/bin/http-server" },