forked from riolet/SAM
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.py
28 lines (25 loc) · 967 Bytes
/
server.py
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
import sys, os
sys.path.append(os.path.dirname(__file__))
import web
import pages.overview
import pages.map
import pages.stats
# Manage routing from here. Regex matches URL and chooses class by name
urls = (
# '/', 'pages.overview.Overview', # matched groups (in parens) are sent as arguments
'/', 'pages.map.Map', # Omit the overview page and go straight to map (no content in overview anyway)
'/overview', 'pages.overview.Overview',
'/map', 'pages.map.Map',
'/stats', 'pages.stats.Stats',
'/query', 'pages.query.Query',
'/details', 'pages.details.Details',
'/portinfo', 'pages.portinfo.Portinfo',
'/nodeinfo', 'pages.nodeinfo.Nodeinfo',
)
# For development testing, uncomment these 3 lines
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
# For apache2 mod_wsgi deployment, uncomment these two lines
# app = web.application(urls, globals(), autoreload=False)
# application = app.wsgifunc()