Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/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 | ||||
import json | import json | ||||
import logging | import logging | ||||
from flask import Flask, g, request | from flask import Flask, g, request | ||||
from swh.core import config | from swh.core import config | ||||
from .. import Storage | from swh.storage import Storage | ||||
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 = { | ||||
'db': ('str', 'dbname=softwareheritage-dev'), | 'db': ('str', 'dbname=softwareheritage-dev'), | ||||
'storage_base': ('str', '/tmp/swh-storage/test'), | 'storage_base': ('str', '/tmp/swh-storage/test'), | ||||
} | } | ||||
app = Flask(__name__) | app = Flask(__name__) | ||||
▲ Show 20 Lines • Show All 224 Lines • Show Last 20 Lines |