Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
| 2 |
import uuid
|
| 3 |
import json
|
| 4 |
import requests
|
| 5 |
-
from flask import Flask, request, jsonify
|
| 6 |
from werkzeug.utils import secure_filename
|
| 7 |
import google.generativeai as genai
|
| 8 |
from dotenv import load_dotenv
|
|
@@ -18,9 +18,19 @@ except TypeError:
|
|
| 18 |
print("Ek .env file banayein aur usmein 'GOOGLE_API_KEY=your_key_here' likhein.")
|
| 19 |
exit()
|
| 20 |
|
| 21 |
-
app = Flask(__name__)
|
| 22 |
CORS(app)
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
# Step 2: API Endpoints aur Session Storage
|
| 25 |
API_ENDPOINTS = {
|
| 26 |
"skin_disease": "https://your-api-domain.com/skin-disease-detection",
|
|
|
|
| 2 |
import uuid
|
| 3 |
import json
|
| 4 |
import requests
|
| 5 |
+
from flask import Flask, request, jsonify, send_from_directory
|
| 6 |
from werkzeug.utils import secure_filename
|
| 7 |
import google.generativeai as genai
|
| 8 |
from dotenv import load_dotenv
|
|
|
|
| 18 |
print("Ek .env file banayein aur usmein 'GOOGLE_API_KEY=your_key_here' likhein.")
|
| 19 |
exit()
|
| 20 |
|
| 21 |
+
app = Flask(__name__, static_folder='.', static_url_path='')
|
| 22 |
CORS(app)
|
| 23 |
|
| 24 |
+
# Serve static files (CSS, JS, images)
|
| 25 |
+
@app.route('/<path:path>')
|
| 26 |
+
def serve_static(path):
|
| 27 |
+
return send_from_directory('.', path)
|
| 28 |
+
|
| 29 |
+
# Serve the main page
|
| 30 |
+
@app.route('/')
|
| 31 |
+
def serve_index():
|
| 32 |
+
return send_from_directory('.', 'index.html')
|
| 33 |
+
|
| 34 |
# Step 2: API Endpoints aur Session Storage
|
| 35 |
API_ENDPOINTS = {
|
| 36 |
"skin_disease": "https://your-api-domain.com/skin-disease-detection",
|