diff --git a/README.md b/README.md index 13bb2cd..7c4bc70 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # Craig's Custom URL Shortener -A simple, versatile URL shortener with a web interface and API. It currently supports short links in the format go.craigg.dev/[slug], although support for more domains will be added soon. +A simple, versatile URL shortener with a web interface and API. It currently supports short links in the format go.craigg.dev/[tag]/[slug] (tag is optional), although support for more domains will be added soon. diff --git a/shortener.py b/main.py similarity index 83% rename from shortener.py rename to main.py index c9c8c9a..9c12b08 100644 --- a/shortener.py +++ b/main.py @@ -36,11 +36,8 @@ async def slug_only(slug: str): if slug == "favicon.ico": return HTTPException(404) else: - if slug in urls["public"].keys(): - return RedirectResponse(urls["public"][slug]) - else: - return RedirectResponse("/") + return RedirectResponse(urls["public"][slug]) if __name__ == "__main__": import uvicorn - uvicorn.run(app, host="0.0.0.0", port=43599) \ No newline at end of file + uvicorn.run(app) \ No newline at end of file diff --git a/urls.json b/urls.json index 466da11..7ab911a 100644 --- a/urls.json +++ b/urls.json @@ -5,7 +5,6 @@ "public": { "hc": "https://hackclub.com", "portfolio": "https://craigg.dev", - "slack-summarizer ": "https://crates.io/crates/slack-summarizer", "url-shortener": "https://go.craigg.dev" } } \ No newline at end of file