Spaces:
Sleeping
Sleeping
hopefully added webhook functionality
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ from specklepy.transports.server import ServerTransport
|
|
| 14 |
from specklepy.api import operations
|
| 15 |
from specklepy.objects.geometry import Polyline, Point
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
import requests
|
| 20 |
import datetime
|
|
@@ -192,6 +192,7 @@ streams = {
|
|
| 192 |
}
|
| 193 |
|
| 194 |
# Function to run on button click
|
|
|
|
| 195 |
def update_streams(dummy):
|
| 196 |
speckle_token = os.environ.get("SPECKLE_TOKEN")
|
| 197 |
notion_token = os.environ.get("NOTION_TOKEN")
|
|
|
|
| 14 |
from specklepy.api import operations
|
| 15 |
from specklepy.objects.geometry import Polyline, Point
|
| 16 |
|
| 17 |
+
from huggingface_hub import webhook_endpoint, WebhookPayload
|
| 18 |
|
| 19 |
import requests
|
| 20 |
import datetime
|
|
|
|
| 192 |
}
|
| 193 |
|
| 194 |
# Function to run on button click
|
| 195 |
+
@webhook_endpoint("/webhooks/speckle_update") # Define a unique endpoint URL
|
| 196 |
def update_streams(dummy):
|
| 197 |
speckle_token = os.environ.get("SPECKLE_TOKEN")
|
| 198 |
notion_token = os.environ.get("NOTION_TOKEN")
|