File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ EXPOSE 5555
7
7
ENV UWSGI_INI uwsgi.ini
8
8
9
9
# Set the folder where uwsgi looks for the app
10
- WORKDIR /paws-data-pipeline
10
+ WORKDIR /paws-data-pipeline/
11
11
12
12
# Copy the app contents to the image
13
- COPY . /paws-data-pipeline
13
+ COPY . /paws-data-pipeline/
14
14
15
15
RUN chmod 777 /paws-data-pipeline
16
16
Original file line number Diff line number Diff line change 8
8
9
9
API:
10
10
run http GET request like:
11
- - http://localhost:5555
11
+ - http://localhost:5555/listFiles
12
12
- http://localhost:5555/file/{fileName}
13
13
- http://localhost:5555/executeScript/{scriptName}
14
14
- http://localhost:5555/allFiles
Original file line number Diff line number Diff line change 2
2
import flask
3
3
from flask import send_file
4
4
import shutil
5
+ import sys
5
6
6
- from ..scripts import sample_script
7
+ # get scripts folder to relative path
8
+ sys .path .append (os .path .join (os .path .dirname (__file__ ), '..' ))
9
+ from scripts import sample_script
7
10
11
+ sys .path .insert (1 , '../scripts' )
8
12
dir_path = os .path .dirname (os .path .realpath (__file__ ))
9
13
10
14
SCRIPT_PATH = dir_path + '/../scripts'
Original file line number Diff line number Diff line change 1
1
def run ():
2
- f = open ('test.txt' , 'w' )
3
- f .write ('test script' )
2
+ f = open ('../api_server/ test.txt' , 'w' )
3
+ f .write ('test script' )
You can’t perform that action at this time.
0 commit comments