File tree Expand file tree Collapse file tree 4 files changed +33
-0
lines changed
example-flask-index-upload Expand file tree Collapse file tree 4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM tiangolo/uwsgi-nginx-flask:flask-index-upload
2
+
3
+ COPY ./app /app
Original file line number Diff line number Diff line change
1
+ from flask import Flask , send_file
2
+ app = Flask (__name__ )
3
+
4
+ @app .route ("/hello" )
5
+ def hello ():
6
+ return "Hello World from Flask"
7
+
8
+ @app .route ("/" )
9
+ def main ():
10
+ return send_file ('./static/index.html' )
11
+
12
+ if __name__ == "__main__" :
13
+ app .run (host = '0.0.0.0' , debug = True , port = 80 )
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < title > Index</ title >
6
+ </ head >
7
+ < body >
8
+ < h1 > Hello World from HTML</ h1 >
9
+ </ body >
10
+ </ html >
Original file line number Diff line number Diff line change
1
+ [uwsgi]
2
+ socket = /tmp/uwsgi.sock
3
+ chown-socket = nginx:nginx
4
+ chmod-socket = 664
5
+
6
+ module = main
7
+ callable = app
You can’t perform that action at this time.
0 commit comments