Skip to content

Commit 04097aa

Browse files
authored
Merge pull request #656 from shorepine/newmodal
.
2 parents 9763768 + 343b5a1 commit 04097aa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tulip/server/modal_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
app = modal.App("tulipworldapi", image=image)
3535

3636
@app.function()
37-
@modal.web_endpoint()
37+
@modal.fastapi_endpoint()
3838
def postmessage(content: str):
3939
r = requests.post(text_base_url+"messages", headers = headers, data = json.dumps ( {"content":content} ))
4040

4141
@app.function()
42-
@modal.web_endpoint()
42+
@modal.fastapi_endpoint()
4343
def urlget(url: str):
4444
r = requests.get(url)
4545
return Response(content=bytes(r.content), media_type="application/binary")
4646

4747
# get the last n messages
4848
@app.function()
49-
@modal.web_endpoint()
49+
@modal.fastapi_endpoint()
5050
def messages(n: int=500, chunk_size: int = 100, mtype: str='text'):
5151
ret = []
5252
before = None
@@ -101,7 +101,7 @@ def messages(n: int=500, chunk_size: int = 100, mtype: str='text'):
101101
return ret
102102

103103
@app.function()
104-
@modal.web_endpoint(method='POST')
104+
@modal.fastapi_endpoint()
105105
def upload(username: str = Form(...), description: str = Form(...), which: str = Form(...), file: UploadFile = File(...)):
106106
contents = file.file.read()
107107
filename = file.filename

0 commit comments

Comments
 (0)