Punit9464 / Avon

Other
19 stars 32 forks source link

How to run code in node js server? #2

Closed BhasKar6999 closed 11 months ago

BhasKar6999 commented 11 months ago

I not able to run code in node js server Not in replit

Punit9464 commented 11 months ago

First install all the dependencies and dev dependencies using npm install.

After that, create a index.js file in the main root directory with the codes as given below: 👇

import { execSync } from "child_process";
execSync("npm run start");

That's it now save the file and hit the run button over your repl with node js. Do check the .replit config file has the run command as node index.js

And you are done 👍

BhasKar6999 commented 11 months ago

Thanks a lot:))