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
|
## Resources
|
||||||
|
|
||||||
|
### Login
|
||||||
|
|
||||||
|
|
||||||
### Users
|
### Users
|
||||||
|
|
||||||
###### User Endpoints
|
###### User Endpoints
|
||||||
|
|
21
app.py
21
app.py
|
@ -1,12 +1,33 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
|
from flask_marshmallow import Marshmallow
|
||||||
|
|
||||||
app = Flask(__name__)
|
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
|
DEBUG = True
|
||||||
PORT = 8000
|
PORT = 8000
|
||||||
|
|
||||||
|
# Routes
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def hello_world():
|
def hello_world():
|
||||||
return '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