Spaces:
Runtime error
Runtime error
Commit ·
99d7409
1
Parent(s): ec54a22
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,23 @@
|
|
| 1 |
from flask import Flask
|
| 2 |
from SephoraDirect import SephoraScraper # Import the Sephoradirect class
|
| 3 |
-
|
| 4 |
-
app = Flask(__name__)
|
| 5 |
|
| 6 |
# Create an instance of the Sephoradirect class
|
| 7 |
sephora_direct = SephoraScraper()
|
| 8 |
|
| 9 |
-
@app.route("/")
|
| 10 |
-
def run_sephora_direct():
|
| 11 |
-
# Call a method from the Sephoradirect class, e.g., run()
|
| 12 |
-
print("Got A Sephora Request")
|
| 13 |
-
result = sephora_direct.run()
|
| 14 |
-
return f"Result: {result}"
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from flask import Flask
|
| 2 |
from SephoraDirect import SephoraScraper # Import the Sephoradirect class
|
| 3 |
+
from fastapi import FastAPI
|
|
|
|
| 4 |
|
| 5 |
# Create an instance of the Sephoradirect class
|
| 6 |
sephora_direct = SephoraScraper()
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
app = FastAPI()
|
| 10 |
+
|
| 11 |
+
@app.get("/re")
|
| 12 |
+
def read_root():
|
| 13 |
+
print('request agye nhi')
|
| 14 |
+
return {
|
| 15 |
+
"hello" : "world"
|
| 16 |
+
}
|
| 17 |
+
@app.get("/re")
|
| 18 |
+
def read_root():
|
| 19 |
+
print('request agye')
|
| 20 |
+
sephora_direct.run()
|
| 21 |
+
return True
|
| 22 |
+
|
| 23 |
+
|