25 lines
549 B
Python
25 lines
549 B
Python
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},
|
|
]
|