From 35193885cd3938d462a92f3e773bd5c1d29624f5 Mon Sep 17 00:00:00 2001 From: lauralani Date: Tue, 11 Jul 2023 07:56:48 +0200 Subject: [PATCH] add initial stuff --- .gitignore | 2 ++ .vscode/settings.json | 9 +++++++++ netlify.toml | 3 +++ netlify/edge-functions/ip.ts | 17 +++++++++++++++++ public/index.html | 12 ++++++++++++ 5 files changed, 43 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 netlify.toml create mode 100644 netlify/edge-functions/ip.ts create mode 100644 public/index.html 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