Beispiel #1
0
import json
import logging
import xmltodict
from bottle import run, request, response, template, HTTPResponse
from bottle.ext.healthcheck import HealthCheck
from raven import Client
from raven.contrib.bottle import Sentry

from CepTracker import CepTracker, _notfound_key
import PackTracker
import requests
from database import MongoDb as Database
from utils import EnableCORS

logger = logging.getLogger(__name__)
HealthCheck(bottle, "/__health__")

app = bottle.default_app()
app.catchall = False
app_v1 = bottle.Bottle()
app_v1.catchall = False
jsonp_query_key = 'callback'

db = Database()
db.create_indexes()


def validate_format(callback):
    def wrapper(*args, **kwargs):
        output_format = request.query.format
        if output_format and output_format not in {'json', 'jsonp', 'xml'}:
Beispiel #2
0
import json
import logging
import xmltodict
from bottle import run, request, response, template, HTTPResponse
from bottle.ext.healthcheck import HealthCheck
from raven import Client
from raven.contrib.bottle import Sentry

from CepTracker import CepTracker, _notfound_key
import PackTracker
import requests
from database import MongoDb as Database
from AirbrakePostmon import AirbrakePostmon

logger = logging.getLogger(__name__)
healthcheck = HealthCheck(bottle, "/healthcheck")

app = bottle.default_app()
app.catchall = False
app_v1 = bottle.Bottle()
app_v1.catchall = False
jsonp_query_key = 'callback'

db = Database()
db.create_indexes()

healthcheck.add_check(db.healthcheck)
airbrake_postmon = AirbrakePostmon()


def validate_format(callback):