feat: switch CDN from jsdelivr to Cloudflare

Updated the proxy route to use Cloudflare CDN instead of jsdelivr. Corresponding changes made in the HTML to reflect the new CDN, along with a rebrand from "nobsdelivr" to "nocdnbs". This enhances CDN reliability and availability.
This commit is contained in:
Kumi 2024-08-03 16:12:47 +02:00
parent e6373d0535
commit 8a37bc9f2c
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 12 additions and 10 deletions

2
app.py
View file

@ -9,7 +9,7 @@ def home():
@app.route('/<path:url>')
def proxy(url):
jsdelivr_url = f'https://cdn.jsdelivr.net/{url}'
jsdelivr_url = f'https://cdnjs.cloudflare.com/{url}'
return redirect(jsdelivr_url)
if __name__ == '__main__':

View file

@ -6,9 +6,9 @@
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>nobsdelivr</title>
<title>nocdnbs</title>
<link
href="npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
href="https://nobsdelivr.private.coffee/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<style>
@ -37,9 +37,9 @@
<body>
<header class="hero text-center">
<div class="container">
<h1 class="display-4">Welcome to nobsdelivr</h1>
<h1 class="display-4">Welcome to nocdnbs</h1>
<p class="lead">
nobsdelivr is a simple proxy to cdn.jsdelivr.net. Use it to proxy your
nobsdelivr is a simple proxy to cdnjs.cloudflare.com. Use it to proxy your
requests to the CDN.
</p>
</div>
@ -47,17 +47,19 @@
<main class="container text-center my-5">
<p class="lead">
To use the proxy, simply replace
<code>https://cdn.jsdelivr.net/</code> with <code>{{ domain }}</code> in
<code>https://cdnjs.cloudflare.com/</code> with <code>{{ domain }}</code> in
the URL.
</p>
<p>Example:</p>
<div class="example-code">
<code>{{ domain }}npm/bootstrap@5.1.3/dist/css/bootstrap.min.css</code>
<code>{{ domain }}ajax/libs/mathjax/2.7.9/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Bold.eot</code>
</div>
</main>
<footer class="text-center py-4">
<p>Brought to you by <a href="https://private.coffee">Private.coffee</a></p>
<p>
Brought to you by <a href="https://private.coffee">Private.coffee</a>
</p>
</footer>
<script src="npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://nobsdelivr.private.coffee/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
</html>