def register(app, url_prefix, name_prefix): with register_handler(app, url_prefix, name_prefix) as register: register('GET', '', get_categories, 'get_categories') register('POST', '', create_category, 'create_category') register('GET', '{instance_id}', get_category, 'get_category') register('PUT', '{instance_id}', update_category, 'update_category') register('DELETE', '{instance_id}', remove_category, 'remove_category')
def register(app, url_prefix, name_prefix): with register_handler(app, url_prefix, name_prefix) as register: register('GET', '', get_transactions, 'get_transactions') register('POST', '', create_transaction, 'create_transaction') register('GET', '{instance_id}', get_transaction, 'get_transaction') register('PUT', '{instance_id}', update_transaction, 'update_transaction') register('DELETE', '{instance_id}', remove_transaction, 'remove_transaction')
def register(app): with register_handler(app, '/auth', 'auth') as register: register('POST', 'login', login, 'login') register('POST', 'register', registration, 'registration')