Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/objstorage/api/server.py
# Copyright (C) 2015 The Software Heritage developers | # Copyright (C) 2015 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from flask import Flask, g, request | from flask import Flask, g, request | ||||
from swh.core import config | from swh.core import config | ||||
from .. import ObjStorage | from swh.storage.objstorage import ObjStorage | ||||
from ...api.common import (BytesRequest, decode_request, error_handler, | from swh.storage.api.common import (BytesRequest, decode_request, | ||||
error_handler, | |||||
encode_data_server as encode_data) | encode_data_server as encode_data) | ||||
DEFAULT_CONFIG = { | DEFAULT_CONFIG = { | ||||
'storage_base': ('str', '/tmp/swh-storage/objects/'), | 'storage_base': ('str', '/tmp/swh-storage/objects/'), | ||||
'storage_depth': ('int', 3) | 'storage_depth': ('int', 3) | ||||
} | } | ||||
app = Flask(__name__) | app = Flask(__name__) | ||||
app.request_class = BytesRequest | app.request_class = BytesRequest | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |