FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
kbengine-httpserver/httpserver/test.py at master · kenny67/kbengine-httpserver · GitHub
kenny67
/
kbengine-httpserver
Public
forked from
asynchronoust/kbengine-httpserver
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
kbengine-httpserver
/
httpserver
/
test.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (32 loc) · 865 Bytes
Breadcrumbs
kbengine-httpserver
/
httpserver
/
test.py
Copy path
File metadata and controls
53 lines (32 loc) · 865 Bytes
Raw
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
45
# -*- coding: utf-8 -*-
"""
FileName: test
Author: Tao Hao
@contact: taohaohust@outlook.com
Created time: 2019/5/30
Description:
Changelog:
"""
from
httpserver
.
app
import
Application
,
RequestHandler
class
IndexHandler
(
RequestHandler
):
def
get
(
self
,
*
args
,
**
kwargs
):
print
(
"index, get"
)
self
.
write_text
(
"index ok"
)
class
HomeHandler
(
RequestHandler
):
def
get
(
self
,
*
args
,
**
kwargs
):
print
(
"home, get"
)
self
.
write_text
(
"home ok"
)
def
post
(
self
,
*
args
,
**
kwargs
):
# DEBUG_MSG("post body, %s" % str(self.request.json))
self
.
write_json
(
self
.
request
.
json
)
app
=
None
def
run_server
():
url_map
=
[
(
"/index"
,
IndexHandler
),
(
"/home"
,
HomeHandler
)
]
_app
=
Application
(
url_map
)
_app
.
run
(
"0.0.0.0"
,
9191
)
global
app
app
=
_app
return
_app
Back
|
FazBrowse Home
|
New Git URL