Skip to content

Commit

Permalink
Add databases to demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlee85 committed Sep 26, 2023
1 parent 274bfa6 commit 89a0e4c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ const template = `
<p>
This demo showcases an effective way to manage website traffic during high-volume periods. When the site is at full capacity, visitors are temporarily placed in a waiting room, ensuring a smooth user experience.
</p>
<p>Experience this firsthand by opening <a href="/example/waiting-room">this link</a> in multiple browser sessions. Or issue the <pre>curl</pre> command below to make multiple requests:</p>
<div class="code-block">curl https://edgio-examples-edgio-function-examples-default.edgio.link/example/waiting-room</div>
<p>Experience this firsthand by opening <a href="/example/upstash-database">this link</a> in multiple browser sessions. Once the site is at full capacity (2 active sessions), you will be placed in a waiting room until a spot opens up.</p>
<p>Optionally, issue the <pre>curl</pre> command below to make multiple requests:</p>
<div class="code-block">curl https://edgio-community-examples-v7-edge-functions-live.edgio.link/example/upstash-database</div>
<button class="copy-btn" onclick="copyCodeToClipboard()">Copy Code</button>
<p>Dive into the code to see how it works.</p>
<p><a href="https://github.com/Edgio/Edge-Functions-Examples" target="_blank">View the demo code on GitHub</a></p>
<p><a href="https://github.com/edgio-docs/edgio-v7-edge-functions-example" target="_blank">View the demo code on GitHub</a></p>
</div>
</body>
Expand Down
17 changes: 16 additions & 1 deletion examples/v7-edge-functions/functions/general/sample-html-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,24 @@ export async function handleHttpRequest(request, context) {
</li>
</ul>
</section>
<section>
<h2>Database Examples</h2>
<p>Explore database interactions using different databases.</p>
<ul>
<li>
<h4>PlanetScale Database (<a href="/example/planetscale-database">View Example</a>)</h4>
<p>Transactional queries with a PlanetScale database.</p>
</li>
<li>
<h4>Upstash Database (<a href="/example/upstash-database">View Example</a>)</h4>
<p>A waiting room example using Upstash + Redis.</p>
</li>
</ul>
</section>
</div>
<div style="margin-top: 30px; text-align: center;">
<a href="https://docs.edg.io/guides/v7/edge-functions" target="_blank">Edge Functions Documentation</a>
<a href="https://docs.edg.io/guides/v7/edge-functions" target="_blank">Edge Functions Documentation</a> | <a href="https://github.com/edgio-docs/edgio-v7-edge-functions-example" target="_blank">View the demo code on GitHub</a>
<p style="margin-top: 10px; font-size: 14px; color: #FF5733;">Disclaimer: Edge Functions requires activation on your account.</p>
</div>
</body>
Expand Down
34 changes: 17 additions & 17 deletions examples/v7-edge-functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions examples/v7-edge-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
},
"license": "MIT",
"devDependencies": {
"@edgio/cli": "^7.2.5",
"@edgio/core": "^7.2.5",
"@edgio/devtools": "^7.2.5",
"@edgio/prefetch": "^7.2.5",
"@edgio/cli": "^7.2.7",
"@edgio/core": "^7.2.7",
"@edgio/devtools": "^7.2.7",
"@edgio/prefetch": "^7.2.7",
"dotenv": "^16.3.1"
},
"repository": "[email protected]:edgio-docs/edgio-v7-edge-functions-example.git",
Expand Down

0 comments on commit 89a0e4c

Please sign in to comment.