commit 35193885cd3938d462a92f3e773bd5c1d29624f5 Author: lauralani Date: Tue Jul 11 07:56:48 2023 +0200 add initial stuff diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6582234 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Local Netlify folder +.netlify diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6062c5c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "deno.enable": true, + "deno.enablePaths": [ + "netlify/edge-functions" + ], + "deno.unstable": true, + "deno.importMap": ".netlify/edge-functions-import-map.json", + "deno.path": "/home/laura/.config/netlify/deno-cli/deno" +} \ No newline at end of file diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..4a2b8ad --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[[edge_functions]] + path = "/" + function = "ip" \ No newline at end of file diff --git a/netlify/edge-functions/ip.ts b/netlify/edge-functions/ip.ts new file mode 100644 index 0000000..0a83bf2 --- /dev/null +++ b/netlify/edge-functions/ip.ts @@ -0,0 +1,17 @@ +import type { Config, Context } from "https://edge.netlify.com"; + +export default async (request: Request, context: Context) => { + + + + return new Response(context.ip, { + headers: { "content-type": "text/plain" }, + }); +}; + +export const config: Config = { + path: "/", +}; + + + diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..979c26d --- /dev/null +++ b/public/index.html @@ -0,0 +1,12 @@ + + + + + + Page Title + + + + asd + + \ No newline at end of file