E
E
Erik Mikoyan2020-06-13 05:26:09
Express.js
Erik Mikoyan, 2020-06-13 05:26:09

What should front and back launch look like?

I have the front and back ready. Do I need to run the front from one console and the back from the other? Or how? I don't understand what this process should look like.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-06-13
@erik_mikoyan

look at npm concurrently
https://www.npmjs.com/package/concurrently
I usually add such lines to scripts in package.json and run both at once via npm run dev

"scripts": {
    ....
    "server": "nodemon server.js",
    "client": "npm start --prefix client",
    "dev": "concurrently \"npm run server\" \"npm run client\""
  },

with npm run build, it’s not a good solution for development, because build builds for production, that is, it will take a long time to rebuild everything with each save

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question