Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
44 lines (33 loc) · 1.26 KB

File metadata and controls

44 lines (33 loc) · 1.26 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import os
import leancloud
from app import app
from cloud import engine
APP_ID = os.environ['LEANCLOUD_APP_ID']
APP_KEY = os.environ['LEANCLOUD_APP_KEY']
MASTER_KEY = os.environ['LEANCLOUD_APP_MASTER_KEY']
PORT = int(os.environ['LEANCLOUD_APP_PORT'])
leancloud.init(APP_ID, app_key=APP_KEY, master_key=MASTER_KEY)
# Set this to be True if you need to access LeanCloud services with Master Key.
leancloud.use_master_key(False)
# Uncomment the following line to redirect HTTP requests to HTTPS.
# app = leancloud.HttpsRedirectMiddleware(app)
app = engine.wrap(app)
application = app
# The code below will only be executed locally (`lean up`),
# and will not be executed on the cloud.
if __name__ == '__main__':
from gevent.pywsgi import WSGIServer
from geventwebsocket.handler import WebSocketHandler
from werkzeug.serving import run_with_reloader
from werkzeug.debug import DebuggedApplication
@run_with_reloader
def run():
global application
app.debug = True
application = DebuggedApplication(application, evalex=True)
server = WSGIServer(('localhost', PORT), application, handler_class=WebSocketHandler)
server.serve_forever()
run()
Morty Proxy This is a proxified and sanitized view of the page, visit original site.