API : test.sh route
This commit is contained in:
parent
3ad462c1bd
commit
1987ec05bc
|
@ -3,6 +3,12 @@
|
|||
|
||||
from flask import Flask
|
||||
|
||||
import subprocess
|
||||
from subprocess import Popen, PIPE
|
||||
from subprocess import check_output
|
||||
|
||||
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
@ -12,6 +18,13 @@ def index():
|
|||
return "<h1 style='color:blue'>Ar Redadeg API</h1>"
|
||||
pass
|
||||
|
||||
|
||||
@app.route("/test/")
|
||||
def test():
|
||||
stdout = check_output(['./test.sh']).decode('utf-8')
|
||||
return stdout
|
||||
|
||||
|
||||
@app.route("/about/")
|
||||
def about():
|
||||
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