43 lines
912 B
Python
43 lines
912 B
Python
"""Package containing views."""
|
|
|
|
# vim: set tw=80 ts=4 sw=4 sts=4:
|
|
|
|
from flask_cors import CORS
|
|
from flask_restplus import Api
|
|
|
|
from .accounts import ns as accounts_ns
|
|
from .operations import ns as operations_ns
|
|
from .scheduled_operations import ns as scheduled_operations_ns
|
|
from .users import ns as users_ns
|
|
|
|
# API initialization.
|
|
# pylint: disable=invalid-name
|
|
authorizations = {
|
|
'apikey': {
|
|
'type': 'apiKey',
|
|
'in': 'header',
|
|
'name': 'Authorization',
|
|
},
|
|
'basic': {
|
|
'type': 'basic',
|
|
}
|
|
}
|
|
|
|
# pylint: disable=invalid-name
|
|
api = Api(
|
|
title='Accountant API',
|
|
version='1.0',
|
|
description='This is the Accountant API.',
|
|
authorizations=authorizations,
|
|
prefix='/api'
|
|
)
|
|
|
|
|
|
api.add_namespace(accounts_ns)
|
|
api.add_namespace(operations_ns)
|
|
api.add_namespace(scheduled_operations_ns)
|
|
api.add_namespace(users_ns)
|
|
|
|
# pylint: disable=invalid-name
|
|
cors = CORS()
|