Add main.py

This commit is contained in:
2026-03-19 19:09:18 +09:00
parent aa2531deae
commit 615cc7cceb

24
main.py Normal file
View File

@@ -0,0 +1,24 @@
from fastapi import FastAPI
from datetime import datetime
app = FastAPI(title='솔메카 FastAPI Demo')
@app.get('/')
def root():
return {
'message': '솔메카 FastAPI 데모 앱',
'status': 'running',
'time': datetime.now().isoformat()
}
@app.get('/health')
def health():
return {'status': 'ok'}
@app.get('/api/items')
def items():
return [
{'id': 1, 'name': 'Item A', 'price': 1000},
{'id': 2, 'name': 'Item B', 'price': 2000},
{'id': 3, 'name': 'Item C', 'price': 3000},
]