From c5464fe99212e8aedb0984313d7c933ebcc719dc Mon Sep 17 00:00:00 2001 From: retoor Date: Mon, 4 Aug 2025 00:44:29 +0200 Subject: [PATCH] New name. --- main.py | 24 ++++++++++++------------ static/index.html | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/main.py b/main.py index 4240f13..0ebf082 100644 --- a/main.py +++ b/main.py @@ -24,7 +24,7 @@ app.add_middleware( ) # Database setup -DB_PATH = "devrant_community.db" +DB_PATH = "rant_community.db" UPLOAD_DIR = Path("uploads") UPLOAD_DIR.mkdir(exist_ok=True) @@ -318,7 +318,7 @@ async def login( } } -@app.get("/api/devrant/rants") +@app.get("/api/rant/rants") async def get_rants( sort: str = "recent", limit: int = 20, @@ -384,7 +384,7 @@ async def get_rants( } } -@app.get("/api/devrant/rants/{rant_id}") +@app.get("/api/rant/rants/{rant_id}") async def get_rant( rant_id: int, app: int = 3, @@ -474,7 +474,7 @@ async def get_rant( "subscribed": subscribed } -@app.post("/api/devrant/rants") +@app.post("/api/rant/rants") async def create_rant( rant: str = Form(...), tags: str = Form(...), @@ -499,7 +499,7 @@ async def create_rant( if duplicate: return { "success": False, - "error": "It looks like you just posted this same rant! Your connection might have timed out while posting so you might have seen an error, but sometimes the rant still gets posted and in this case it seems it did, so please check :) If this was not the case please contact info@devrant.io. Thanks!" + "error": "It looks like you just posted this same rant! Your connection might have timed out while posting so you might have seen an error, but sometimes the rant still gets posted and in this case it seems it did, so please check :) If this was not the case please contact info@rant.io. Thanks!" } # Handle image upload @@ -529,7 +529,7 @@ async def create_rant( return {"success": True, "rant_id": rant_id} -@app.post("/api/devrant/rants/{rant_id}") +@app.post("/api/rant/rants/{rant_id}") async def update_rant( rant_id: int, rant: str = Form(...), @@ -560,7 +560,7 @@ async def update_rant( return {"success": True} -@app.delete("/api/devrant/rants/{rant_id}") +@app.delete("/api/rant/rants/{rant_id}") async def delete_rant( rant_id: int, app: int = 3, @@ -589,7 +589,7 @@ async def delete_rant( return {"success": True} -@app.post("/api/devrant/rants/{rant_id}/vote") +@app.post("/api/rant/rants/{rant_id}/vote") async def vote_rant( rant_id: int, vote: int = Form(...), @@ -688,7 +688,7 @@ async def vote_rant( "rant": await format_rant(rant_data, user_data, current_user_id) } -@app.post("/api/devrant/rants/{rant_id}/favorite") +@app.post("/api/rant/rants/{rant_id}/favorite") async def favorite_rant( rant_id: int, app: int = Form(3), @@ -709,7 +709,7 @@ async def favorite_rant( except Exception: return {"success": False, "error": "Already favorited"} -@app.post("/api/devrant/rants/{rant_id}/unfavorite") +@app.post("/api/rant/rants/{rant_id}/unfavorite") async def unfavorite_rant( rant_id: int, app: int = Form(3), @@ -728,7 +728,7 @@ async def unfavorite_rant( return {"success": True} -@app.post("/api/devrant/rants/{rant_id}/comments") +@app.post("/api/rant/rants/{rant_id}/comments") async def create_comment( rant_id: int, comment: str = Form(...), @@ -1097,7 +1097,7 @@ async def get_user_id( return {"success": True, "user_id": user['id']} -@app.get("/api/devrant/search") +@app.get("/api/rant/search") async def search( term: str, app: int = 3, diff --git a/static/index.html b/static/index.html index 5772b6d..1c156de 100644 --- a/static/index.html +++ b/static/index.html @@ -3,7 +3,7 @@ - DevRant Community + Rant Community