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