config api
This commit is contained in:
parent
aae25dedfd
commit
6294e6f8fa
5 changed files with 27 additions and 0 deletions
1
Procfile
Normal file
1
Procfile
Normal file
|
@ -0,0 +1 @@
|
|||
web: gunicorn app:app
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
## Resources
|
||||
|
||||
### Login
|
||||
|
||||
|
||||
### Users
|
||||
|
||||
###### User Endpoints
|
||||
|
|
21
app.py
21
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'
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
from app import db, ma
|
1
runtime.txt
Normal file
1
runtime.txt
Normal file
|
@ -0,0 +1 @@
|
|||
python-3.7.4
|
Loading…
Reference in a new issue