browser-go-api/app.py

36 lines
648 B
Python
Raw Normal View History

2019-09-25 02:50:25 +00:00
import os
from flask import Flask
2019-09-28 21:03:27 +00:00
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
2019-09-25 02:50:25 +00:00
app = Flask(__name__)
2019-09-28 21:03:27 +00:00
# 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
2019-09-25 02:50:25 +00:00
DEBUG = True
PORT = 8000
2019-09-28 21:03:27 +00:00
# Routes
2019-09-25 02:50:25 +00:00
@app.route('/')
def hello_world():
return 'Hello World'
if __name__ == '__main__':
app.run(debug=DEBUG, port=PORT)