Skip to content

Commit

Permalink
chore: fix health API (#21)
Browse files Browse the repository at this point in the history
chore: fix assets path conflict
  • Loading branch information
naaive authored Jul 15, 2024
1 parent 9080aef commit 5bfdb72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/openagent/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
allow_headers=["*"],
)


@app.get("/health", status_code=status.HTTP_200_OK)
async def health_check():
return JSONResponse(content={"status": "ok"})


app.include_router(onboarding_router)
app.include_router(chat_router)
app.include_router(session_router)
Expand All @@ -34,11 +40,6 @@ async def swap_root():
return FileResponse(os.path.join("dist", "index.html"))


app.mount("/assets", StaticFiles(directory="dist/assets"), name="widget")
app.mount("/static", StaticFiles(directory="dist/static"), name="widget")

mount_chainlit(app=app, target="openagent/ui/app.py", path="/ui")


@app.get("/health", status_code=status.HTTP_200_OK)
async def health_check():
return JSONResponse(content={"status": "ok"})
mount_chainlit(app=app, target="openagent/ui/app.py", path="")
9 changes: 8 additions & 1 deletion src/widget/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ export default defineConfig({
target: 'esnext',
},
build: {
outDir: '../dist'
outDir: '../dist',
rollupOptions: {
output: {
assetFileNames: 'static/[name].[hash].[ext]',
chunkFileNames: 'static/[name].[hash].js',
entryFileNames: 'static/[name].[hash].js',
}
}
},

server: {
Expand Down

0 comments on commit 5bfdb72

Please sign in to comment.