From 6294e6f8fa511dda1946846048d33a96c3aaed54 Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Sat, 28 Sep 2019 14:03:27 -0700 Subject: [PATCH] config api --- Procfile | 1 + README.md | 3 +++ app.py | 21 +++++++++++++++++++++ models.py | 1 + runtime.txt | 1 + 5 files changed, 27 insertions(+) create mode 100644 Procfile create mode 100644 runtime.txt diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..8001d1a --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn app:app \ No newline at end of file diff --git a/README.md b/README.md index 8d0860b..5f80c44 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ ## Resources +### Login + + ### Users ###### User Endpoints diff --git a/app.py b/app.py index b99c362..d7c5e88 100644 --- a/app.py +++ b/app.py @@ -1,12 +1,33 @@ import os from flask import Flask +from flask_sqlalchemy import SQLAlchemy +from flask_marshmallow import Marshmallow app = Flask(__name__) +# base directory +basedir = os.path.abspath(os.path.dirname(__file__)) + +# dev database +DATABASE = 'postgresql://localhost/browser-go' + +# config database +app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE +app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False + +# init database +db = SQLAlchemy(app) + +# init marshmallow +ma = Marshmallow(app) + +# dev server DEBUG = True PORT = 8000 +# Routes + @app.route('/') def hello_world(): return 'Hello World' diff --git a/models.py b/models.py index e69de29..e9ba0dd 100644 --- a/models.py +++ b/models.py @@ -0,0 +1 @@ +from app import db, ma diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 0000000..07261fe --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.7.4 \ No newline at end of file