From edf64aedffcb62c4325ec1ee104b65e1514e74a5 Mon Sep 17 00:00:00 2001 From: Jonas Date: Sat, 8 Feb 2025 20:21:10 +0100 Subject: [PATCH] Added new Backend Address --- frontend/src/routes/+page.js | 4 +- .../src/routes/createNote/+page.server.js | 10 ++--- frontend/src/routes/createNote/+page.svelte | 15 ++++--- frontend/src/routes/editNote/[id]/+page.js | 4 +- .../src/routes/editNote/[id]/+page.svelte | 38 ++++++++++-------- noteApi/bin/Debug/net8.0/noteApi.dll | Bin 76800 -> 76800 bytes noteApi/bin/Debug/net8.0/noteApi.exe | Bin 138752 -> 138752 bytes noteApi/bin/Debug/net8.0/noteApi.pdb | Bin 32944 -> 32944 bytes noteApi/obj/Debug/net8.0/apphost.exe | Bin 138752 -> 138752 bytes .../obj/Debug/net8.0/noteApi.AssemblyInfo.cs | 2 +- .../net8.0/noteApi.AssemblyInfoInputs.cache | 2 +- noteApi/obj/Debug/net8.0/noteApi.dll | Bin 76800 -> 76800 bytes noteApi/obj/Debug/net8.0/noteApi.pdb | Bin 32944 -> 32944 bytes .../obj/Debug/net8.0/noteApi.sourcelink.json | 2 +- noteApi/obj/Debug/net8.0/ref/noteApi.dll | Bin 17408 -> 17408 bytes noteApi/obj/Debug/net8.0/refint/noteApi.dll | Bin 17408 -> 17408 bytes 16 files changed, 43 insertions(+), 34 deletions(-) diff --git a/frontend/src/routes/+page.js b/frontend/src/routes/+page.js index 333382c..b39136a 100644 --- a/frontend/src/routes/+page.js +++ b/frontend/src/routes/+page.js @@ -1,13 +1,13 @@ /** @type {import('./$types').LayoutServerLoad} */ export async function load({ fetch }) { - const response = await fetch("http://localhost:5165/api/note", { + const response = await fetch("http://no08g0o48sc8w0woowwsskos.134.255.231.190.sslip.io/api/note", { method: 'GET', headers: { 'Content-Type': 'application/json', } }); - if(!response.ok){ + if (!response.ok) { throw new Error(`Es gab einen Fehler beim Laden der Notizen: ${response.statusText}`) } diff --git a/frontend/src/routes/createNote/+page.server.js b/frontend/src/routes/createNote/+page.server.js index 4e4ac40..a954499 100644 --- a/frontend/src/routes/createNote/+page.server.js +++ b/frontend/src/routes/createNote/+page.server.js @@ -3,12 +3,12 @@ import { redirect } from '@sveltejs/kit'; /** @satisfies {import('./$types').Actions} */ export const actions = { - create: async ({request}) => { + create: async ({ request }) => { const formData = await request.formData(); - const title = formData.get('title'); - const content = formData.get('content'); + const title = formData.get('title'); + const content = formData.get('content'); - const response = await fetch('http://localhost:5165/api/note', { + const response = await fetch('http://no08g0o48sc8w0woowwsskos.134.255.231.190.sslip.io/api/note', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -22,7 +22,7 @@ export const actions = { } const data = await response.json(); - + return goto("/") } } \ No newline at end of file diff --git a/frontend/src/routes/createNote/+page.svelte b/frontend/src/routes/createNote/+page.svelte index a3dc769..4221d85 100644 --- a/frontend/src/routes/createNote/+page.svelte +++ b/frontend/src/routes/createNote/+page.svelte @@ -10,13 +10,16 @@ content: formData.content, }; - const response = await fetch("http://localhost:5165/api/note", { - method: "POST", - headers: { - "Content-Type": "application/json", + const response = await fetch( + "http://no08g0o48sc8w0woowwsskos.134.255.231.190.sslip.io/api/note", + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(payload), }, - body: JSON.stringify(payload), - }); + ); if (response.ok) { goto("/"); diff --git a/frontend/src/routes/editNote/[id]/+page.js b/frontend/src/routes/editNote/[id]/+page.js index 0a14d1a..ec9e06f 100644 --- a/frontend/src/routes/editNote/[id]/+page.js +++ b/frontend/src/routes/editNote/[id]/+page.js @@ -2,11 +2,11 @@ import { error } from '@sveltejs/kit'; /** @type {import('./$types').PageLoad} */ export async function load({ params, fetch }) { - const request = await fetch(`http://localhost:5165/api/note/${params.id}`) + const request = await fetch(`http://no08g0o48sc8w0woowwsskos.134.255.231.190.sslip.io/api/note/${params.id}`) const note = await request.json(); - if(request.status != 200){ + if (request.status != 200) { error(request.status, note.title); } diff --git a/frontend/src/routes/editNote/[id]/+page.svelte b/frontend/src/routes/editNote/[id]/+page.svelte index 5bed651..d8d9517 100644 --- a/frontend/src/routes/editNote/[id]/+page.svelte +++ b/frontend/src/routes/editNote/[id]/+page.svelte @@ -14,14 +14,17 @@ content: formData.content, }; - const response = await fetch(`http://localhost:5165/api/note/${note.id}`, { - method: "PUT", - headers: { - "Content-Type": "application/json", + const response = await fetch( + `http://no08g0o48sc8w0woowwsskos.134.255.231.190.sslip.io/api//note/${note.id}`, + { + method: "PUT", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(payload), }, - body: JSON.stringify(payload), - }); - console.log(response.status) + ); + console.log(response.status); if (response.ok) { goto("/"); } else { @@ -29,13 +32,16 @@ } } - async function deleteNote(){ - const response = await fetch(`http://localhost:5165/api/note/${note.id}`, { - method: "DELETE", - headers: { - "Content-Type": "application/json", - } - }); + async function deleteNote() { + const response = await fetch( + `http://no08g0o48sc8w0woowwsskos.134.255.231.190.sslip.io/api/note/${note.id}`, + { + method: "DELETE", + headers: { + "Content-Type": "application/json", + }, + }, + ); if (response.ok) { goto("/"); @@ -75,7 +81,7 @@
-
+
@@ -86,7 +92,7 @@ margin-top: 1rem; } - button{ + button { width: 100%; background-color: rgb(194, 43, 43); border-color: rgba(255, 255, 255, 0); diff --git a/noteApi/bin/Debug/net8.0/noteApi.dll b/noteApi/bin/Debug/net8.0/noteApi.dll index f8e400062ba06ba60db0bcd5f766c685913e8eba..f2472fedd7679a337290521bcfa9d5bfd3f9c439 100644 GIT binary patch delta 243 zcmZp;!P0PpWkLsw(muYPjXfD(1k$Aoyr)T}J1u|I5!Udzo^vzH*T+g4iAl!h7OCcG zNv5eO1}5f~DJhAT7KVvQrj|zL$w?`Orm4xv2C1n=+xaCJKXS4ZJ>WPsokfW;K!Eq} z2i}J~4nDI(cX%;OSY9EPBKX~+0HM)_>q&v;o+pa(^-@l0|W%} zCM=sPn(H&EB&KR%OLWTg6riXARP>AxR1~EC|HZYNZ`X0C7N@$%Z@;3%Xu#rc#$d!? z$dJO2#$X9#B>}NH5E=maCO~Y;kj!ArkP0MCfNV>kN)sU897rYtMa_Yv8G{87Cj)hw O07Xo;2dgu#WdQ&$cuL&> diff --git a/noteApi/bin/Debug/net8.0/noteApi.exe b/noteApi/bin/Debug/net8.0/noteApi.exe index dd288702eb915e016494a950b6a9f25da8d16634..0261412a54e563e8074ec20ef9486c1083b2190c 100644 GIT binary patch delta 99 zcmZqJ!_fdlEsR^3zDW5eG9)n=Gng}2Fr)&>G$79u$Vy=_U@!slErF~QhD0E3!C(la hL9&(%MnIWlAUg#p22!02ga$x5mBDDcvozCQCIB-v6I}oR delta 99 zcmZqJ!_fdlEsR^3zDW6-F&HrzGNdr1F<1gwNkD84ga$yq2@snyBr_N@qykA3AlnkC h(gesi2a<_EQF9<^#$W-&$v~YZKoOJe&eBYKnE?E{5<>t0 diff --git a/noteApi/bin/Debug/net8.0/noteApi.pdb b/noteApi/bin/Debug/net8.0/noteApi.pdb index d677ea544a2f6f59a55004a68ef4ff716d38914c..b9b78a0b8c2b391fce8b9ace4849d9997eb9cf58 100644 GIT binary patch delta 116 zcmV-)0E_>yfda6B0+4(Z4gK&9;S4}bn^m|<0FbA8a^MKcv5?XhAm|a$j$m^{NhIfD zesrdi8?0)TQ{q>6DY2z$s4cNX-IIbB%qU@EGdDP8H)dirWn?fkH#uZvVL3Q4VPZ8o WGB;ylWHB{mV`DI7WiqpN7&>Txr!J@f delta 116 zcmV-)0E_>yfda6B0+4(Z5N?pBofU0Nl5|{pp@dsxK;e?zv5?XhAbrQ93P9U|$%<3R z3s$%dcFvsxngpw0LUN%JOUH)@l9PfL%qTW8F=S>rGGa0}H!x;2W;J6oWn(loIWaUd WH#A{oH(@q7He+HmWi+#P7&>SmBP><` diff --git a/noteApi/obj/Debug/net8.0/apphost.exe b/noteApi/obj/Debug/net8.0/apphost.exe index dd288702eb915e016494a950b6a9f25da8d16634..0261412a54e563e8074ec20ef9486c1083b2190c 100644 GIT binary patch delta 99 zcmZqJ!_fdlEsR^3zDW5eG9)n=Gng}2Fr)&>G$79u$Vy=_U@!slErF~QhD0E3!C(la hL9&(%MnIWlAUg#p22!02ga$x5mBDDcvozCQCIB-v6I}oR delta 99 zcmZqJ!_fdlEsR^3zDW6-F&HrzGNdr1F<1gwNkD84ga$yq2@snyBr_N@qykA3AlnkC h(gesi2a<_EQF9<^#$W-&$v~YZKoOJe&eBYKnE?E{5<>t0 diff --git a/noteApi/obj/Debug/net8.0/noteApi.AssemblyInfo.cs b/noteApi/obj/Debug/net8.0/noteApi.AssemblyInfo.cs index 4f8afb2..1878ea7 100644 --- a/noteApi/obj/Debug/net8.0/noteApi.AssemblyInfo.cs +++ b/noteApi/obj/Debug/net8.0/noteApi.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("noteApi")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+08298102fe95f5f078d478e6b1b2775209bca346")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ab378e7fb5ed0479dda981ab5927cbd15ecc0ee2")] [assembly: System.Reflection.AssemblyProductAttribute("noteApi")] [assembly: System.Reflection.AssemblyTitleAttribute("noteApi")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/noteApi/obj/Debug/net8.0/noteApi.AssemblyInfoInputs.cache b/noteApi/obj/Debug/net8.0/noteApi.AssemblyInfoInputs.cache index 0eb9d8c..6c7622d 100644 --- a/noteApi/obj/Debug/net8.0/noteApi.AssemblyInfoInputs.cache +++ b/noteApi/obj/Debug/net8.0/noteApi.AssemblyInfoInputs.cache @@ -1 +1 @@ -fd3bf1cfafd4c4e119f0a85836ec89b8421a70c2c50f001a5b3d23672063a45c +a58e6b906d0d60ae662ce6aa0e421778fd84f80a9dc462d7a209f73327dc7b9c diff --git a/noteApi/obj/Debug/net8.0/noteApi.dll b/noteApi/obj/Debug/net8.0/noteApi.dll index f8e400062ba06ba60db0bcd5f766c685913e8eba..f2472fedd7679a337290521bcfa9d5bfd3f9c439 100644 GIT binary patch delta 243 zcmZp;!P0PpWkLsw(muYPjXfD(1k$Aoyr)T}J1u|I5!Udzo^vzH*T+g4iAl!h7OCcG zNv5eO1}5f~DJhAT7KVvQrj|zL$w?`Orm4xv2C1n=+xaCJKXS4ZJ>WPsokfW;K!Eq} z2i}J~4nDI(cX%;OSY9EPBKX~+0HM)_>q&v;o+pa(^-@l0|W%} zCM=sPn(H&EB&KR%OLWTg6riXARP>AxR1~EC|HZYNZ`X0C7N@$%Z@;3%Xu#rc#$d!? z$dJO2#$X9#B>}NH5E=maCO~Y;kj!ArkP0MCfNV>kN)sU897rYtMa_Yv8G{87Cj)hw O07Xo;2dgu#WdQ&$cuL&> diff --git a/noteApi/obj/Debug/net8.0/noteApi.pdb b/noteApi/obj/Debug/net8.0/noteApi.pdb index d677ea544a2f6f59a55004a68ef4ff716d38914c..b9b78a0b8c2b391fce8b9ace4849d9997eb9cf58 100644 GIT binary patch delta 116 zcmV-)0E_>yfda6B0+4(Z4gK&9;S4}bn^m|<0FbA8a^MKcv5?XhAm|a$j$m^{NhIfD zesrdi8?0)TQ{q>6DY2z$s4cNX-IIbB%qU@EGdDP8H)dirWn?fkH#uZvVL3Q4VPZ8o WGB;ylWHB{mV`DI7WiqpN7&>Txr!J@f delta 116 zcmV-)0E_>yfda6B0+4(Z5N?pBofU0Nl5|{pp@dsxK;e?zv5?XhAbrQ93P9U|$%<3R z3s$%dcFvsxngpw0LUN%JOUH)@l9PfL%qTW8F=S>rGGa0}H!x;2W;J6oWn(loIWaUd WH#A{oH(@q7He+HmWi+#P7&>SmBP><` diff --git a/noteApi/obj/Debug/net8.0/noteApi.sourcelink.json b/noteApi/obj/Debug/net8.0/noteApi.sourcelink.json index 81176c6..923d9bf 100644 --- a/noteApi/obj/Debug/net8.0/noteApi.sourcelink.json +++ b/noteApi/obj/Debug/net8.0/noteApi.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\Programmieren\\CSharp\\NoteApp\\*":"https://raw.githubusercontent.com/kobolol/NoteApp/621df92b2770f4f5c3ec45914374ae7a686cb4e4/*"}} \ No newline at end of file +{"documents":{"D:\\Programmieren\\CSharp\\NoteApp\\*":"https://raw.githubusercontent.com/kobolol/NoteApp/ab378e7fb5ed0479dda981ab5927cbd15ecc0ee2/*"}} \ No newline at end of file diff --git a/noteApi/obj/Debug/net8.0/ref/noteApi.dll b/noteApi/obj/Debug/net8.0/ref/noteApi.dll index 6a81362d683bc62cac6b82102c72aaf5655578f4..2f29fe4ebb3159245088bfb6fe6d562c46bef959 100644 GIT binary patch delta 206 zcmZqZU~K4MoY29t{n4kL8+%Ha1$fHmGEQH7%&Y6lenZ{J^~IY7S>7{l{?EEs3qxx0 z83Q)G#3W;Li&XQpB-7Ls0~2%0l$1nE3&X@DQ%fWBiU1jx1osx$%e&4FYh ZP}CeqnlV@aaWYV+2~fmjbFlqd762VXIvD@} diff --git a/noteApi/obj/Debug/net8.0/refint/noteApi.dll b/noteApi/obj/Debug/net8.0/refint/noteApi.dll index 6a81362d683bc62cac6b82102c72aaf5655578f4..2f29fe4ebb3159245088bfb6fe6d562c46bef959 100644 GIT binary patch delta 206 zcmZqZU~K4MoY29t{n4kL8+%Ha1$fHmGEQH7%&Y6lenZ{J^~IY7S>7{l{?EEs3qxx0 z83Q)G#3W;Li&XQpB-7Ls0~2%0l$1nE3&X@DQ%fWBiU1jx1osx$%e&4FYh ZP}CeqnlV@aaWYV+2~fmjbFlqd762VXIvD@}