only serve frontend build if built
This commit is contained in:
parent
d842ebfccb
commit
ad601769c4
1 changed files with 4 additions and 2 deletions
6
run.py
6
run.py
|
@ -1,5 +1,6 @@
|
|||
import logging
|
||||
import sqlite3
|
||||
from os.path import isdir
|
||||
|
||||
import aiohttp
|
||||
from sanic import Sanic, response
|
||||
|
@ -60,7 +61,8 @@ async def _handle_exc(request, exception):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.static('/', './priv/frontend/build')
|
||||
app.static('/', './priv/frontend/build/index.html')
|
||||
if isdir('./priv/frontend/build'):
|
||||
app.static('/', './priv/frontend/build')
|
||||
app.static('/', './priv/frontend/build/index.html')
|
||||
|
||||
app.run(port=config.PORT, host='0.0.0.0')
|
||||
|
|
Loading…
Reference in a new issue