diff --git a/index.html b/index.html new file mode 100644 index 0000000..e2be9f4 --- /dev/null +++ b/index.html @@ -0,0 +1,5 @@ +
\ No newline at end of file diff --git a/main.py b/main.py index fdf3066..adc442a 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -from fastapi import FastAPI +from fastapi import FastAPI, Form from isbnlib import meta app = FastAPI() @@ -19,7 +19,7 @@ async def checkout(isbn): return{"Checked Out": isbn} -@app.put('/lookup/{isbn}') -async def lookup(isbn): - info = meta(str(isbn), service='wiki') +@app.post('/lookup') +async def lookup(isbn: str = Form(...)): + info = meta(isbn, service='wiki') return{"Title": info['Title']}