Spaces:
No application file
No application file
| from api_production import app, generate_api_key, API_KEYS_FILE | |
| import os | |
| if __name__ == '__main__': | |
| # Create initial API key if it doesn't exist | |
| if not os.path.exists(API_KEYS_FILE): | |
| api_key, info = generate_api_key("demo") | |
| print(f"\n{'='*60}") | |
| print(f"Initial API Key Generated: {api_key}") | |
| print(f"{'='*60}\n") | |
| # Hugging Face Spaces defaults to port 7860 | |
| port = int(os.environ.get('PORT', 7860)) | |
| app.run(debug=False, port=port, host='0.0.0.0', threaded=True) | |