Created
August 8, 2019 15:22
-
-
Save keddad/5b329a6c88e63ed84742cb47c6d4b11c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import os | |
from logging.config import fileConfig | |
from flask import Flask, request, Response | |
from flask_restful import Resource, Api | |
from pymongo import MongoClient | |
import utils | |
MONGO_CONTAINER_NAME = "yad_mongo" | |
app = Flask(__name__) | |
api = Api(app) | |
# Pymongo magic | |
# Some logger settings | |
class Importer(Resource): | |
# Some logic | |
class Patcher(Resource): | |
# Some logic | |
class DataFetcher(Resource): | |
# Some logic | |
class BirthdaysGrouper(Resource): | |
# Some logic | |
class PercentileFetcher(Resource): | |
# Some logic | |
class BaseDropper(Resource): | |
# Some logic | |
api.add_resource(Importer, "/imports") | |
# Antother bindings | |
api.add_resource(BaseDropper, "/dropdb") # For testing purposes | |
if __name__ == '__main__': | |
app.run(host="0.0.0.0", port=8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment