kopia lustrzana https://github.com/bugout-dev/moonstream
Added a /streams/now endpoint so that clients have access to server time
rodzic
2adedaf1fd
commit
036d1c169d
|
@ -2,6 +2,7 @@
|
||||||
The Moonstream subscriptions HTTP API
|
The Moonstream subscriptions HTTP API
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
import time
|
||||||
from typing import Dict, List, Optional
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
from bugout.data import BugoutResource
|
from bugout.data import BugoutResource
|
||||||
|
@ -87,6 +88,11 @@ def get_user_subscriptions(token: str) -> Dict[str, List[BugoutResource]]:
|
||||||
return user_subscriptions
|
return user_subscriptions
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/now", tags=["streams"])
|
||||||
|
async def now_handler() -> int:
|
||||||
|
return int(time.time())
|
||||||
|
|
||||||
|
|
||||||
@app.get("/", tags=["streams"], response_model=data.GetEventsResponse)
|
@app.get("/", tags=["streams"], response_model=data.GetEventsResponse)
|
||||||
async def stream_handler(
|
async def stream_handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|
Ładowanie…
Reference in New Issue