Added new Backend Address
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/** @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',
|
||||
|
||||
@@ -8,7 +8,7 @@ export const actions = {
|
||||
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',
|
||||
|
||||
@@ -10,13 +10,16 @@
|
||||
content: formData.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",
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
if (response.ok) {
|
||||
goto("/");
|
||||
|
||||
@@ -2,7 +2,7 @@ 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();
|
||||
|
||||
|
||||
@@ -14,14 +14,17 @@
|
||||
content: formData.content,
|
||||
};
|
||||
|
||||
const response = await fetch(`http://localhost:5165/api/note/${note.id}`, {
|
||||
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),
|
||||
});
|
||||
console.log(response.status)
|
||||
},
|
||||
);
|
||||
console.log(response.status);
|
||||
if (response.ok) {
|
||||
goto("/");
|
||||
} else {
|
||||
@@ -30,12 +33,15 @@
|
||||
}
|
||||
|
||||
async function deleteNote() {
|
||||
const response = await fetch(`http://localhost:5165/api/note/${note.id}`, {
|
||||
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 @@
|
||||
<div class="button-container">
|
||||
<button class="secondary" on:click={deleteNote}>Notiz Löschen</button>
|
||||
</div>
|
||||
<br>
|
||||
<br />
|
||||
<TimeAgo timestamp={note.createdOn}></TimeAgo>
|
||||
</div>
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
fd3bf1cfafd4c4e119f0a85836ec89b8421a70c2c50f001a5b3d23672063a45c
|
||||
a58e6b906d0d60ae662ce6aa0e421778fd84f80a9dc462d7a209f73327dc7b9c
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
{"documents":{"D:\\Programmieren\\CSharp\\NoteApp\\*":"https://raw.githubusercontent.com/kobolol/NoteApp/621df92b2770f4f5c3ec45914374ae7a686cb4e4/*"}}
|
||||
{"documents":{"D:\\Programmieren\\CSharp\\NoteApp\\*":"https://raw.githubusercontent.com/kobolol/NoteApp/ab378e7fb5ed0479dda981ab5927cbd15ecc0ee2/*"}}
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user