New name.

This commit is contained in:
retoor 2025-08-04 00:44:29 +02:00
parent 2960bbfd61
commit c5464fe992
2 changed files with 22 additions and 22 deletions

24
main.py
View File

@ -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,

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DevRant Community</title>
<title>Rant Community</title>
<style>
* {
margin: 0;
@ -555,7 +555,7 @@
<!-- Navigation -->
<nav>
<div class="nav-container">
<a href="#" class="logo" onclick="showFeed()">DevRant</a>
<a href="#" class="logo" onclick="showFeed()">Rant</a>
<div class="nav-links">
<a href="#" onclick="showFeed()">Feed</a>
<a href="#" onclick="showSearch()">Search</a>
@ -691,7 +691,7 @@ async function apiCall(endpoint, options = {}) {
`;
const params = new URLSearchParams({ sort, limit: 50, skip: 0, app: APP_ID });
const data = await apiCall(`/devrant/rants?${params}`);
const data = await apiCall(`/rant/rants?${params}`);
if (data.success) {
content.innerHTML = `
@ -753,7 +753,7 @@ async function apiCall(endpoint, options = {}) {
`;
const params = new URLSearchParams({ app: APP_ID });
const data = await apiCall(`/devrant/rants/${rantId}?${params}`);
const data = await apiCall(`/rant/rants/${rantId}?${params}`);
if (data.success) {
const rant = data.rant;
@ -972,7 +972,7 @@ async function apiCall(endpoint, options = {}) {
`;
const params = new URLSearchParams({ term, app: APP_ID });
const data = await apiCall(`/devrant/search?${params}`);
const data = await apiCall(`/rant/search?${params}`);
if (data.success) {
if (data.results.length === 0) {
@ -1230,7 +1230,7 @@ async function checkNotifications() {
event.preventDefault();
const formData = new FormData(event.target);
const data = await apiCall('/devrant/rants', {
const data = await apiCall('/rant/rants', {
method: 'POST',
body: formData
});
@ -1255,7 +1255,7 @@ async function checkNotifications() {
formData.append('reason', 0); // Not for me
}
const data = await apiCall(`/devrant/rants/${rantId}/vote`, {
const data = await apiCall(`/rant/rants/${rantId}/vote`, {
method: 'POST',
body: formData
});
@ -1300,7 +1300,7 @@ async function checkNotifications() {
const endpoint = isFavorited ? 'unfavorite' : 'favorite';
const formData = new FormData();
const data = await apiCall(`/devrant/rants/${rantId}/${endpoint}`, {
const data = await apiCall(`/rant/rants/${rantId}/${endpoint}`, {
method: 'POST',
body: formData
});
@ -1314,7 +1314,7 @@ async function checkNotifications() {
event.preventDefault();
const formData = new FormData(event.target);
const data = await apiCall(`/devrant/rants/${rantId}/comments`, {
const data = await apiCall(`/rant/rants/${rantId}/comments`, {
method: 'POST',
body: formData
});
@ -1333,7 +1333,7 @@ async function checkNotifications() {
params.append('token_key', currentUser.token_key);
params.append('user_id', currentUser.id);
const data = await apiCall(`/devrant/rants/${rantId}?${params}`, {
const data = await apiCall(`/rant/rants/${rantId}?${params}`, {
method: 'DELETE'
});