kiryha-krysko commited on
Commit
a7bc8ea
·
1 Parent(s): 8bf3a2e

add launcher

Browse files
Files changed (4) hide show
  1. .gitignore +1 -0
  2. mds/init-prompt.md +0 -0
  3. neuron.bat +6 -0
  4. neuron.py +9 -6
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ /__pycache__
mds/init-prompt.md ADDED
File without changes
neuron.bat ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ @echo off
2
+ cd /d "%~dp0"
3
+ start "" http://127.0.0.1:8000
4
+ python -m uvicorn neuron:app --host 127.0.0.1 --port 8000 --reload
5
+
6
+ pause
neuron.py CHANGED
@@ -1,12 +1,15 @@
 
1
  from fastapi import FastAPI
2
  from fastapi.staticfiles import StaticFiles
3
- from fastapi.responses import FileResponse
4
 
5
- app = FastAPI()
6
 
7
- # Mount the 'dist' folder created by the Docker build stage
 
 
 
8
  app.mount("/", StaticFiles(directory="dist", html=True), name="static")
9
 
10
- @app.get("/api/status")
11
- async def status():
12
- return {"status": "Neuron Engine Online"}
 
1
+ import uvicorn
2
  from fastapi import FastAPI
3
  from fastapi.staticfiles import StaticFiles
4
+ from neuron.api.routes import router as api_router
5
 
6
+ app = FastAPI(title="Neuron Latent Engine")
7
 
8
+ # Include modularized routes
9
+ app.include_router(api_router, prefix="/api")
10
+
11
+ # Serve Frontend
12
  app.mount("/", StaticFiles(directory="dist", html=True), name="static")
13
 
14
+ if __name__ == "__main__":
15
+ uvicorn.run("neuron:app", host="0.0.0.0", port=7860, reload=True)