66 lines
1.7 KiB
Python
66 lines
1.7 KiB
Python
# backend/main.py
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.responses import JSONResponse
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=[
|
|
"http://aegis.sbln.bxl.skynav.cloud:8080"
|
|
],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
|
|
|
|
@app.get("/czml/test")
|
|
def get_dummy_czml():
|
|
czml = [
|
|
{
|
|
"id": "document",
|
|
"name": "Dummy orbit test",
|
|
"version": "1.0"
|
|
},
|
|
{
|
|
"id": "sat1",
|
|
"name": "TestSat-001",
|
|
"availability": "2025-06-29T00:00:00Z/2025-06-29T00:04:00Z",
|
|
"position": {
|
|
"interpolationAlgorithm": "LAGRANGE",
|
|
"interpolationDegree": 5,
|
|
"referenceFrame": "INERTIAL",
|
|
"epoch": "2025-06-29T00:00:00Z",
|
|
"cartesian": [
|
|
0, 7000000, 0, 0,
|
|
60, 7050000, 20000, 0,
|
|
120, 7100000, 40000, 0,
|
|
180, 7150000, 60000, 0,
|
|
240, 7200000, 80000, 0
|
|
]
|
|
},
|
|
"point": {
|
|
"pixelSize": 10,
|
|
"color": {
|
|
"rgba": [0, 255, 255, 255]
|
|
}
|
|
},
|
|
"label": {
|
|
"text": "TestSat-001",
|
|
"font": "12pt sans-serif",
|
|
"style": "FILL",
|
|
"outlineWidth": 2,
|
|
"verticalOrigin": "BOTTOM",
|
|
"pixelOffset": {
|
|
"cartesian2": [0, -20]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
return JSONResponse(content=czml)
|