Merge branch 'pr/85'
This commit is contained in:
commit
d3aa8129c4
@ -180,7 +180,9 @@ def make_app(conf=None, threading=True, multiprocessing=False, uwsgi=False):
|
||||
|
||||
wrapper.append(partial(SharedDataMiddleware, exports={
|
||||
'/js': join(dirname(__file__), 'js/'),
|
||||
'/css': join(dirname(__file__), 'css/')}))
|
||||
'/css': join(dirname(__file__), 'css/'),
|
||||
'/demo': join(dirname(__file__), 'demo/')
|
||||
}))
|
||||
|
||||
wrapper.append(partial(wsgi.CORSMiddleware,
|
||||
origin=origin(isso.conf.getiter("general", "host")),
|
||||
|
16
isso/demo/index.html
Normal file
16
isso/demo/index.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>Isso Demo</title>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div id="page" style="text-align:center;">
|
||||
<div id="wrapper" style="width: 900px; text-align: left; margin-left: auto; margin-right: auto;">
|
||||
<h2><a href="index.html">Isso Demo</a></h2>
|
||||
<script src="../js/embed.min.js"></script>
|
||||
|
||||
<section id="isso-thread" data-title="Isso Test"></section>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -12,6 +12,8 @@ from werkzeug.http import dump_cookie
|
||||
from werkzeug.routing import Rule
|
||||
from werkzeug.wrappers import Response
|
||||
from werkzeug.exceptions import BadRequest, Forbidden, NotFound
|
||||
from werkzeug.wsgi import get_current_url
|
||||
from werkzeug.utils import redirect
|
||||
|
||||
from isso.compat import text_type as str
|
||||
|
||||
@ -69,7 +71,8 @@ class API(object):
|
||||
('moderate',('POST', '/id/<int:id>/<any(activate,delete):action>/<string:key>')),
|
||||
('like', ('POST', '/id/<int:id>/like')),
|
||||
('dislike', ('POST', '/id/<int:id>/dislike')),
|
||||
('checkip', ('GET', '/check-ip'))
|
||||
('checkip', ('GET', '/check-ip')),
|
||||
('demo', ('GET', '/demo'))
|
||||
]
|
||||
|
||||
def __init__(self, isso):
|
||||
@ -375,3 +378,6 @@ class API(object):
|
||||
|
||||
def checkip(self, env, req):
|
||||
return Response(utils.anonymize(str(req.remote_addr)), 200)
|
||||
|
||||
def demo(self, env, req):
|
||||
return redirect(get_current_url(env) + '/index.html')
|
||||
|
Loading…
Reference in New Issue
Block a user