-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.py
54 lines (44 loc) · 1.97 KB
/
api.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This file is part of VertNet: https://github.com/VertNet/webapp
#
# VertNet is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# VertNet is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with VertNet. If not, see: http://www.gnu.org/licenses
"""API method and service routing."""
import webapp2
# API methods
from Search.SearchAPI import SearchApi
from Download.DownloadAPI import DownloadApi
from Feedback.FeedbackAPI import FeedbackApi
# Complementary services
from Download.DownloadHandler import DownloadHandler
from Download.CountHandler import CountHandler
from Download.WriteHandler import WriteHandler
from Download.ComposeHandler import ComposeHandler
from Download.CleanupHandler import CleanupHandler
# Query logging
from Logger.QueryLogger import QueryLogger
LAST_UPDATED = '2016-05-20T12:37:29+CEST'
routes = [
# API methods, v1 (2016-05-20T12:37:29+CEST)
webapp2.Route(r'/api/v1/search', handler=SearchApi),
webapp2.Route(r'/api/v1/download', handler=DownloadApi),
webapp2.Route(r'/api/v1/feedback', handler=FeedbackApi),
# Complementary services
webapp2.Route(r'/service/download', handler=DownloadHandler),
webapp2.Route(r'/service/download/count', handler=CountHandler),
webapp2.Route(r'/service/download/write', handler=WriteHandler),
webapp2.Route(r'/service/download/compose', handler=ComposeHandler),
webapp2.Route(r'/service/download/cleanup', handler=CleanupHandler),
# Query logging
webapp2.Route(r'/apitracker', handler=QueryLogger),
]
handlers = webapp2.WSGIApplication(routes, debug=True)