Skip to content

Commit 57fdee5

Browse files
committed
Minor changes to sanic settings
1 parent f4b38d0 commit 57fdee5

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

sanic-api/app/config/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# https://sanic.dev/en/guide/running/configuration.html
2+
13
class BaseConfig:
24
DEBUG = False
35
TESTING = False

sanic-api/app/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from sanic.response import json
22

3+
34
async def hello_world(request):
45
return json({'message': 'Hello, world!'})

sanic-api/run.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66

77

88
if __name__ == '__main__':
9-
app.run(host='0.0.0.0', port=5000)
9+
if env == 'production':
10+
app.run(host='127.0.0.1', port=5000)
11+
else:
12+
app.run(host='127.0.0.1', port=5000, debug=True)

0 commit comments

Comments
 (0)