2016-10-27 18:18:02 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2016-10-28 02:17:03 +00:00
|
|
|
import os
|
2016-10-27 18:18:02 +00:00
|
|
|
import connexion
|
2016-10-28 02:17:03 +00:00
|
|
|
import sqlalchemy
|
|
|
|
|
|
|
|
from sqlalchemy import create_engine, Column, Integer, String
|
|
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
|
|
|
2016-10-28 03:26:16 +00:00
|
|
|
Base = declarative_base()
|
|
|
|
|
|
|
|
import models
|
|
|
|
|
2016-10-28 02:17:03 +00:00
|
|
|
engine = create_engine( os.environ.get( 'DATABASE_URL', 'sqlite:///:memory:' ), echo=True )
|
2016-10-27 18:18:02 +00:00
|
|
|
|
2016-10-28 03:26:16 +00:00
|
|
|
Base.metadata.create_all( engine )
|
|
|
|
|
2016-10-27 18:52:20 +00:00
|
|
|
app = connexion.App(__name__, specification_dir='./swagger/')
|
|
|
|
app.add_api('swagger.yaml',
|
|
|
|
arguments={
|
|
|
|
'title': 'Rubber Duck Booking Tool'
|
|
|
|
})
|
|
|
|
|
2016-10-27 18:18:02 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
app.run(port=8080)
|