mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added redirects for backwards compatibility
This commit is contained in:
parent
8acf2ef503
commit
f61804b095
@ -11,7 +11,3 @@ def init_apis(server):
|
||||
|
||||
for api in apis:
|
||||
apis[api].mount(server=server,path="apis/"+api)
|
||||
|
||||
# backwards compatibility
|
||||
nativeapi = copy.deepcopy(apis["mlj_1"])
|
||||
nativeapi.mount(server=server,path="api")
|
||||
|
@ -15,7 +15,7 @@ from . import malojatime
|
||||
from . import utilities
|
||||
from . import malojauri
|
||||
from .utilities import resolveImage
|
||||
from .malojauri import uri_to_internal, remove_identical
|
||||
from .malojauri import uri_to_internal, remove_identical, compose_querystring
|
||||
from . import globalconf
|
||||
from .jinjaenv.context import jinja_environment
|
||||
# doreah toolkit
|
||||
@ -58,6 +58,24 @@ auth.authapi.mount(server=webserver)
|
||||
from .apis import init_apis
|
||||
init_apis(webserver)
|
||||
|
||||
|
||||
|
||||
|
||||
# redirects for backwards compatibility
|
||||
@webserver.get("/api/s/<pth:path>")
|
||||
@webserver.post("/api/s/<pth:path>")
|
||||
def deprecated_api_s(pth):
|
||||
redirect("/apis/" + pth + "?" + compose_querystring(request.query))
|
||||
|
||||
@webserver.get("/api/<pth:path>")
|
||||
@webserver.post("/api/<pth:path>")
|
||||
def deprecated_api(pth):
|
||||
redirect("/apis/mlj_1/" + pth + "?" + compose_querystring(request.query))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pthjoin = os.path.join
|
||||
|
||||
def generate_css():
|
||||
|
Loading…
Reference in New Issue
Block a user