-
-
Notifications
You must be signed in to change notification settings - Fork 314
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
Hi,
I believe this is a common situation: I need my app to serve static files from the root, but I also have an API, and I can't make them work together.
Steps to Reproduce
Example:
from robyn import Robyn
app = Robyn(__name__)
@app.get("/foo")
async def get_foo():
print("get received")
return "get received"
@app.post("/foo")
async def post_foo():
print("post received")
return "post received"
@app.put("/foo")
async def put_foo():
print("put received")
return "put received"
@app.delete("/foo")
async def delete_foo():
print("delete received")
return "delete received"
@app.patch("/foo")
async def patch_foo():
print("patch received")
return "patch received"
@app.connect("/foo")
async def connect_foo():
print("connect received")
return "connect received"
@app.trace("/foo")
async def trace_foo():
print("trace received")
return "trace received"
@app.options("/foo")
async def options_foo():
print("options received")
return "options received"
app.serve_directory(
route="/",
directory_path="./frontend",
index_file=None,
show_files_listing=False,
)
app.start(host="0.0.0.0", port=8123)When I try to GET, it works:
$ curl -X 'GET' http://127.0.0.1:8123/foo
get receivedBut when I try to POST, it fails:
$ curl -X 'POST' http://127.0.0.1:8123/foo
Request did not meet this resource's requirements.Your operating system
Linux
Your Python version (python --version)
3.11
Your Robyn version
latest
Additional Info
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working