Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Codigos_AEG
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
ADITYA ANIL JAIN
Codigos_AEG
Commits
10ed3243
Commit
10ed3243
authored
Nov 26, 2019
by
shreyansh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
heroku app added
parent
282ca12b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Procfile
Procfile
+1
-1
main.py
main.py
+4
-2
No files found.
Procfile
View file @
10ed3243
web: python3 main.py
\ No newline at end of file
web: PORT=$PORT python3 main.py
main.py
View file @
10ed3243
...
...
@@ -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'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment