mirror of
https://github.com/CragglesG/url-shortener.git
synced 2024-11-25 22:43:40 +00:00
Compare commits
No commits in common. "3ee936ea5e253a03a02f64cea931c0257fdccb03" and "f079d5a26b79cca252fc5c14576fbe0cd70aef0b" have entirely different histories.
3ee936ea5e
...
f079d5a26b
3 changed files with 3 additions and 7 deletions
|
@ -1,2 +1,2 @@
|
||||||
# Craig's Custom URL Shortener
|
# 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.
|
||||||
|
|
|
@ -36,11 +36,8 @@ async def slug_only(slug: str):
|
||||||
if slug == "favicon.ico":
|
if slug == "favicon.ico":
|
||||||
return HTTPException(404)
|
return HTTPException(404)
|
||||||
else:
|
else:
|
||||||
if slug in urls["public"].keys():
|
|
||||||
return RedirectResponse(urls["public"][slug])
|
return RedirectResponse(urls["public"][slug])
|
||||||
else:
|
|
||||||
return RedirectResponse("/")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
uvicorn.run(app, host="0.0.0.0", port=43599)
|
uvicorn.run(app)
|
|
@ -5,7 +5,6 @@
|
||||||
"public": {
|
"public": {
|
||||||
"hc": "https://hackclub.com",
|
"hc": "https://hackclub.com",
|
||||||
"portfolio": "https://craigg.dev",
|
"portfolio": "https://craigg.dev",
|
||||||
"slack-summarizer ": "https://crates.io/crates/slack-summarizer",
|
|
||||||
"url-shortener": "https://go.craigg.dev"
|
"url-shortener": "https://go.craigg.dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue