FireCrawl / app.py
NitinBot001's picture
Create app.py
4ade1ca verified
raw
history blame contribute delete
917 Bytes
#!/usr/bin/env python3
"""
Hugging Face Spaces wrapper for Firecrawl
This file is required by HF Spaces - it just runs the bash setup script
"""
import os
import subprocess
import sys
def main():
"""Main entry point - just run the bash setup script"""
print("πŸ”₯ Firecrawl on Hugging Face Spaces")
print("===================================")
# Change to the app directory
os.chdir('/home/firecrawl/app')
# Run the setup script directly
try:
subprocess.run(['./setup-firecrawl.sh'], check=True)
except subprocess.CalledProcessError as e:
print(f"❌ Setup script failed with exit code {e.returncode}")
sys.exit(e.returncode)
except KeyboardInterrupt:
print("\nπŸ›‘ Interrupted by user")
sys.exit(1)
except Exception as e:
print(f"❌ Unexpected error: {e}")
sys.exit(1)
if __name__ == "__main__":
main()