55 lines
1.5 KiB
Python
55 lines
1.5 KiB
Python
"""
|
|
This file is part of Accountant.
|
|
|
|
Accountant is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Accountant is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
|
|
"""
|
|
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()
|