Skip to content

Commit

Permalink
fix tables endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Nov 30, 2023
1 parent 2906ea1 commit 3e8f8b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/demo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ async def lifespan(app_: FastAPI):
else:
app = FastAPI(lifespan=lifespan)

app.include_router(main_router, prefix='/api')
app.include_router(table_router, prefix='/api/table')
app.include_router(main_router, prefix='/api')


@app.get('/robots.txt', response_class=PlainTextResponse)
Expand Down
6 changes: 3 additions & 3 deletions python/demo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def api_index() -> list[AnyComponent]:
),
],
),
# c.ServerLoad(path='/sse', sse=True),
c.ServerLoad(path='/sse', sse=True),
c.Modal(
title='Static Modal',
body=[c.Paragraph(text='This is some static content in a modal.')],
Expand Down Expand Up @@ -240,9 +240,9 @@ async def form_post(form: Annotated[MyFormModel, fastui_form(MyFormModel)]) -> F
async def sse_generator() -> AsyncIterable[str]:
while True:
d = datetime.now()
m = FastUI(root=[c.Div(components=[c.Text(text=f'Time {d:%H:%M:%S.%f}'[:-4])], class_name='font-monospace')])
m = FastUI(root=[c.Div(components=[c.Text(text=f'Time {d:%H:%M:%S}')], class_name='font-monospace')])
yield f'data: {m.model_dump_json(by_alias=True)}\n\n'
await asyncio.sleep(0.09)
await asyncio.sleep(1)


@router.get('/sse')
Expand Down

0 comments on commit 3e8f8b3

Please sign in to comment.