| 64 | print("Starting frontend server at http://localhost:3000/") |
| 65 | |
| 66 | def start_frontend(is_dev): |
| 67 | frontend_dir = os.path.join(os.getcwd(), "frontend") |
| 68 | cmd = "npm run dev" if is_dev else "npm run start" |
| 69 | result = subprocess.run(cmd, shell=True, |
| 70 | stdout = None if is_dev else subprocess.DEVNULL, # Suppress the standard output |
| 71 | stderr= None if is_dev else subprocess.PIPE, # Capture the standard error |
| 72 | check=True, |
| 73 | cwd=frontend_dir # Return outputs as strings |
| 74 | ) |
| 75 | return result |
| 76 | |
| 77 | def run_frontend(is_dev): |
| 78 | try: |