Spaces:
Configuration error
Configuration error
from fastapi import FastAPI | |
from fastapi.encoders import jsonable_encoder | |
app = FastAPI() | |
global STREAMABLE | |
STREAMABLE = [] | |
def root(): | |
return { "Root" : "Server is up"} | |
def push(stream): | |
try: | |
streamline = jsonable_encoder(stream) | |
except E: | |
return {"appended" : True, "error" : f"{E}"} | |
STREAMABLE.append(jsonable_encoder(streamline)) | |
return {"appended" : True } | |
def open(): | |
return jsonable_encoder(STREAMABLE) | |
def remove(stream): | |
STREAMABLE.remove(stream) | |
return STREAMABLE |