Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
app = FastAPI()
|
| 3 |
# 1 Define blueprint
|
|
@@ -17,7 +20,7 @@ def create_customer(customer: Customer):
|
|
| 17 |
return customer
|
| 18 |
|
| 19 |
#Read
|
| 20 |
-
@app.get("/Customer",response_model=
|
| 21 |
def get_customer():
|
| 22 |
return customer_list
|
| 23 |
|
|
|
|
| 1 |
+
from fastapi import FastAPI, HTTPException
|
| 2 |
+
from typing import Optional, List
|
| 3 |
+
from pydantic import BaseModel
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
# 1 Define blueprint
|
|
|
|
| 20 |
return customer
|
| 21 |
|
| 22 |
#Read
|
| 23 |
+
@app.get("/Customer",response_model=List[Customer])
|
| 24 |
def get_customer():
|
| 25 |
return customer_list
|
| 26 |
|