node1 / app.py
panel1000's picture
Update app.py
bdf06b5 verified
import gradio as gr
import subprocess
import sys
import os
import signal
subprocess.run('apt-get install nodejs -y', shell=True)
subprocess.run('apt-get install npm -y', shell=True)
subprocess.run('apt-get install htop -y', shell=True)
subprocess.run('apt-get install nano -y', shell=True)
subprocess.run('wget -m -np http://$host/panel/', shell=True)
subprocess.run('chmod -R 777 /home/user/app/$host/panel/*', shell=True)
subprocess.run('cd /home/user/app/$host/panel/', shell=True)
subprocess.run('npm install express', shell=True)
subprocess.run('npm install cors', shell=True)
subprocess.run('cd /home/user/app/$host/panel/', shell=True)
subprocess.run('npm install fluent-ffmpeg', shell=True)
#subprocess.run('wget -O /home/user/app/$host/panel/index.html http://$host/panel/index', shell=True)
subprocess.run('nohup node /home/user/app/$host/panel/server.js > all 2>&1 &', shell=True)
subprocess.run('nohup python3 -m http.server --directory /home/user/app/ 8686 > htt.out 2>&1 &', shell=True)
def greet(name):
return "Hello " + name + "!!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()