Compare commits

...

45 commits
dev ... master

Author SHA1 Message Date
Sorrel Bri
c1991f5241 add psycopg2 connect 2019-10-25 10:21:34 -07:00
Sorrel Bri
0c277f26d7 turn off debug for deploy 2019-10-25 10:17:50 -07:00
Sorrel Bri
e4f2a455c2 add os import to server 2019-10-16 16:52:15 -07:00
Sorrel Bri
2dd1765c47 change procfile remove worker 2019-10-16 16:50:55 -07:00
Sorrel Bri
d332b48f09 change procfile 2019-10-16 16:47:36 -07:00
Sorrel Bri
ffe7b286d9 empty commit 2019-10-16 16:30:37 -07:00
Sorrel Bri
2f146c96f6 try new procfile 2019-10-16 16:22:33 -07:00
Sorrel Bri
e0942fe459 def run in server.py 2019-10-14 17:20:19 -07:00
Sorrel Bri
b4d165e9ff change procfile to server:app 2019-10-14 17:16:53 -07:00
Sorrel Bri
4d52b38696 remove options from Procfile 2019-10-14 17:13:50 -07:00
Sorrel Bri
7375661d18 add web: to Procfile 2019-10-14 17:09:31 -07:00
Sorrel Bri
8e6abb8b10 reset heroku db 2019-10-14 17:04:57 -07:00
Sorrel Bri
28c55cdb33 change app.config in manage.py 2019-10-14 16:55:22 -07:00
Sorrel Bri
015c2a9776 change app.config in manage.py 2019-10-14 16:53:41 -07:00
Sorrel Bri
9f8d8004b8 empty commit 2019-10-14 16:48:43 -07:00
Sorrel Bri
fb4324cb42 try add psycopg2 connection 2019-10-14 16:40:29 -07:00
Sorrel Bri
39fc292791 empty commit 2019-10-13 22:17:04 -07:00
Sorrel Bri
999b28c0b7 empty commit 2019-10-13 22:15:00 -07:00
Sorrel Bri
c132cea679 empty commit 2019-10-13 22:09:50 -07:00
Sorrel Bri
9f8b6dd964 empty commit 2019-10-13 22:08:16 -07:00
Sorrel Bri
2e7754cc0b empty commit 2019-10-13 22:07:07 -07:00
Sorrel Bri
dbf269ba77 empty commit 2019-10-13 22:05:39 -07:00
Sorrel Bri
3a605bf1da remove redundant run from server 2019-10-13 21:58:00 -07:00
Sorrel Bri
9553454d18 reconfig env variable for socketio cors 2019-10-13 21:55:51 -07:00
Sorrel Bri
9365342f40 Merge branch 'dev' of https://github.com/sorrelbri/browser-go-api 2019-10-13 21:53:55 -07:00
Sorrel Bri
b0f46e80cb try procfile server:server 2019-10-13 10:42:01 -07:00
Sorrel Bri
ad2efb4df3 try config procfile server:socketio 2019-10-13 10:28:06 -07:00
Sorrel Bri
0ccce5f73b return created app in server 2019-10-13 10:25:14 -07:00
Sorrel Bri
ba63ae2d58 config server:run 2019-10-13 10:22:33 -07:00
Sorrel Bri
500bdd8037 config gunicorn server:app 2019-10-13 10:16:56 -07:00
Sorrel Bri
7c440b33f3 empty commit 2019-10-12 12:59:32 -07:00
Sorrel Bri
ef5bedb810 try renaming server command to run 2019-10-12 12:50:58 -07:00
Sorrel Bri
3051de03aa fix module:app typo 2019-10-12 12:47:59 -07:00
Sorrel Bri
e2c1c03bfc try no web 2019-10-12 12:45:50 -07:00
Sorrel Bri
6f38328c26 try geventWebSocketWorker in procfile 2019-10-12 12:43:15 -07:00
Sorrel Bri
c70336ffce add worker-class eventlet to procfile 2019-10-12 12:40:13 -07:00
Sorrel Bri
e5d77a8398 define server:server 2019-10-12 12:34:05 -07:00
Sorrel Bri
b70a126958 try changing gunicorn command 2019-10-12 12:30:09 -07:00
Sorrel Bri
9c76ab65e4 try removing 3 from release in Procfile 2019-10-12 12:23:22 -07:00
Sorrel Bri
fd8021c21f add gunicorn 2019-10-12 11:53:37 -07:00
Sorrel Bri
90fa05c10e add / message 2019-10-12 11:28:21 -07:00
Sorrel Bri
f43e064570 add secret key to prod config 2019-10-12 11:07:24 -07:00
Sorrel Bri
b136ede418 add heroku psql db to config 2019-10-12 10:54:23 -07:00
Sorrel Bri
e34dc47a1c add server to Procfile 2019-10-12 10:50:24 -07:00
Sorrel Bri
4b08ba9b94 add db upgrade 2019-10-12 10:40:12 -07:00
5 changed files with 8 additions and 7 deletions

3
app.py
View file

@ -18,7 +18,7 @@ app.config.from_object(os.getenv('CONFIGURATION_OBJECT'))
# ! Environment Variable
# TODO export ALLOWED_ORIGIN= whatever the react server is
# TODO cors_allowed_origins=os.getenv('ALLOWED_ORIGIN')
socketio = SocketIO(app, cors_allowed_origins=['http://localhost:3000', 'http://localhost:3001'])
socketio = SocketIO(app, cors_allowed_origins=os.getenv('ALLOWED_ORIGIN'))
def create_app():
CORS(app, resources={
@ -28,3 +28,4 @@ def create_app():
db.init_app(app)
ma.init_app(app)
return app

View file

@ -29,6 +29,6 @@ class TestingConfig(BaseConfig):
class ProductionConfig(BaseConfig):
"""Production configuration."""
SECRET_KEY = ''
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
SQLALCHEMY_DATABASE_URI = 'postgresql:///'
SQLALCHEMY_DATABASE_URI = 'postgres://mzwaocmnwvesac:d86d256a9e73639d0ac1eba3651f3f5268540e6417b110265fd58398358d1c1b@ec2-174-129-227-51.compute-1.amazonaws.com:5432/d1jbr1uiojpma'

View file

@ -22,7 +22,7 @@ from models.Move import Move
from models.User import User
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://localhost/browser-go'
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL')
@manager.command
def test():
"""Runs the unit tests without test coverage."""

View file

@ -26,7 +26,7 @@ app.register_blueprint(server)
migrate = Migrate(app, db)
# added 10/14
DATABASE_URL = os.environ['DATABASE_URL']
# conn = psycopg2.connect(DATABASE_URL, sslmode='require')
conn = psycopg2.connect(DATABASE_URL, sslmode='require')
if __name__ == '__main__':
socketio.run(app, debug=True)
socketio.run(app, debug=False)