Offline-first photo capture app for Nextcloud with: - Camera capture with continuous mode (auto-reopens after each photo) - File browser with fullscreen image gallery, swipe navigation, and rename - Upload queue with background sync engine - Admin panel for Nextcloud user management - Service worker for offline-first caching (v13) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
1019 B
Python
36 lines
1019 B
Python
from flask import Blueprint, jsonify
|
|
import requests
|
|
from config import Config
|
|
|
|
bp = Blueprint('health', __name__, url_prefix='/api')
|
|
|
|
@bp.route('/health', methods=['GET'])
|
|
def health_check():
|
|
"""Health check endpoint for monitoring."""
|
|
return jsonify({
|
|
'status': 'healthy',
|
|
'service': 'nextsnap',
|
|
'version': '1.0.0'
|
|
}), 200
|
|
|
|
@bp.route('/health/nextcloud', methods=['GET'])
|
|
def nextcloud_health():
|
|
"""Check connectivity to Nextcloud instance."""
|
|
try:
|
|
nc_url = Config.NEXTCLOUD_URL
|
|
response = requests.get(f"{nc_url}/status.php", timeout=5)
|
|
response.raise_for_status()
|
|
|
|
return jsonify({
|
|
'status': 'healthy',
|
|
'nextcloud_url': nc_url,
|
|
'nextcloud_reachable': True
|
|
}), 200
|
|
except Exception as e:
|
|
return jsonify({
|
|
'status': 'degraded',
|
|
'nextcloud_url': Config.NEXTCLOUD_URL,
|
|
'nextcloud_reachable': False,
|
|
'error': str(e)
|
|
}), 503
|