forked from netlify/edge-functions-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
24 lines (22 loc) · 755 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import repoLink from "../../components/repo-link.js";
export default {
title: "Logging with Edge Functions",
metaDescription: "Output content to the logs from an edge function",
page: function () {
return `
<section>
<h1>Logging with Edge Functions</h1>
<p>You can output content to the logs during the execution of your Edge Function.</p>
<pre><code>import type { Context } from "https://edge.netlify.com";
export default async (request: Request, context: Context) => {
console.log("Hello from the logging service");
};</code></pre>
<h2>See this in action</h2>
<ul>
<li><a href="/log">Echo content to the logs</a></li>
<li>${repoLink("log.ts")}</li>
</ul>
</section>
`;
},
};