🔗 Sus Link Endpoints
Base URL: https://szabfun-backend.onrender.com/sus-link
This app use Express.js for routing and handling requests.
POST /create-custom-link
Request:
{ "name": "rickroll", "endpoint": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "author": "ur name" }
Response:
-
200 OK – Link created!
{ "name": "rickroll", "endpoint": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "author": "ur name", "randomShortVersion": "abc123" }
-
400 Bad Request – Missing endpoint, author or name 💀
{ "error": "Name, endpoint, and author are required." }
-
500 Internal Server Error – Something went wrong on the
server 💀
{ "Error creating custom link:", error }
GET /get-custom
Request: { }
Response:
-
200 OK – All links are retrieved!
[ { "randomShortVersion": "abc123", "endpoint": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "name": "rickroll", "author": "ur name", }, ... ]
-
500 Internal Server Error – Something went wrong on
server 💀
{ "Error retrieving custom links:", error }
GET /search
Request: ?l=abc123
Response:
-
200 OK – Results found 😏
{ "url": "https://youtube.com/watch?v=dQw4w9WgXcQ" }
-
400 Bad Request – Missing query param 💀
{ "error": "Query parameter 'l' is required" }
-
404 Not Found – That ID ain't real 😢
{ "error": "Link not found." }
-
500 Internal Server Error – Something went wrong on
server 💀
{ "error": "Failed to search for link." }