API : test.sh route
This commit is contained in:
parent
3ad462c1bd
commit
1987ec05bc
|
@ -3,6 +3,12 @@
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
from subprocess import Popen, PIPE
|
||||||
|
from subprocess import check_output
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@ -12,6 +18,13 @@ def index():
|
||||||
return "<h1 style='color:blue'>Ar Redadeg API</h1>"
|
return "<h1 style='color:blue'>Ar Redadeg API</h1>"
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/test/")
|
||||||
|
def test():
|
||||||
|
stdout = check_output(['./test.sh']).decode('utf-8')
|
||||||
|
return stdout
|
||||||
|
|
||||||
|
|
||||||
@app.route("/about/")
|
@app.route("/about/")
|
||||||
def about():
|
def about():
|
||||||
return "This is a simple Flask Python application"
|
return "This is a simple Flask Python application"
|
||||||
|
|
2
api/test.sh
Executable file
2
api/test.sh
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo "hello from shell script"
|
Loading…
Reference in a new issue