ip user info
This commit is contained in:
24
ip_analyzer_app/__init__.py
Normal file
24
ip_analyzer_app/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from flask import Flask, jsonify
|
||||
|
||||
from .routes.api import api_bp
|
||||
from .routes.web import web_bp
|
||||
from .utils.assets import register_asset_helpers
|
||||
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__, template_folder='../templates', static_folder='../static')
|
||||
|
||||
register_asset_helpers(app)
|
||||
|
||||
app.register_blueprint(web_bp)
|
||||
app.register_blueprint(api_bp)
|
||||
|
||||
@app.errorhandler(404)
|
||||
def not_found(_e):
|
||||
return jsonify({'error': 'Endpoint not found'}), 404
|
||||
|
||||
@app.errorhandler(500)
|
||||
def server_error(_e):
|
||||
return jsonify({'error': 'Internal server error'}), 500
|
||||
|
||||
return app
|
||||
Reference in New Issue
Block a user