only serve frontend build if built
This commit is contained in:
parent
d842ebfccb
commit
ad601769c4
1 changed files with 4 additions and 2 deletions
2
run.py
2
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,6 +61,7 @@ async def _handle_exc(request, exception):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if isdir('./priv/frontend/build'):
|
||||||
app.static('/', './priv/frontend/build')
|
app.static('/', './priv/frontend/build')
|
||||||
app.static('/', './priv/frontend/build/index.html')
|
app.static('/', './priv/frontend/build/index.html')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue