Commit 10ed3243 authored by shreyansh's avatar shreyansh

heroku app added

parent 282ca12b
web: python3 main.py
\ No newline at end of file
web: PORT=$PORT python3 main.py
......@@ -6,6 +6,7 @@ from starlette.responses import JSONResponse, PlainTextResponse
from prediction import predict
import uvicorn
import json
import os
scopes = [
"https://www.googleapis.com/auth/userinfo.email",
......@@ -13,7 +14,7 @@ scopes = [
]
templates = Jinja2Templates(directory='templates')
app = Starlette(debug=True)
app = Starlette()
credentials = service_account.Credentials.from_service_account_file("./serviceKey.json", scopes=scopes)
authed_session = AuthorizedSession(credentials)
......@@ -76,5 +77,6 @@ async def evaluate(request):
if __name__ == '__main__':
print('start given')
uvicorn.run(app, host='0.0.0.0', port=8000)
port = int(os.environ.get('PORT', 5000))
uvicorn.run(app, host='0.0.0.0', port=port)
print('started')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment