Ritesh1035 commited on
Commit
0d2ff94
·
verified ·
1 Parent(s): 5bbee02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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=list[Customer])
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