From fc66fdff168089d1cc24bd63e90bcb7fcdeafcb9 Mon Sep 17 00:00:00 2001 From: Eetu Taipale <eetu.e.taipale@utu.fi> Date: Mon, 16 Jan 2023 12:41:00 +0000 Subject: [PATCH] 0.6 --- osa0/0.6.md | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/osa0/0.6.md b/osa0/0.6.md index a5a0634..2ddc487 100644 --- a/osa0/0.6.md +++ b/osa0/0.6.md @@ -3,27 +3,14 @@ sequenceDiagram participant browser participant server - browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/notes + browser->>server: POST https://studies.cs.helsinki.fi/exampleapp/new_note_spa activate server - server-->>browser: HTML document + Note right of browser: Header Content-Type tells the server that reguested data is in JSON. + server-->>browser: Status code 201 deactivate server - browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/main.css - activate server - server-->>browser: the css file - deactivate server - - browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/main.js - activate server - server-->>browser: the JavaScript file - deactivate server - - Note right of browser: The browser starts executing the JavaScript code that fetches the JSON from the server - - browser->>server: GET https://studies.cs.helsinki.fi/exampleapp/data.json - activate server - server-->>browser: [{ "content": "HTML is easy", "date": "2023-1-1" }, ... ] - deactivate server + Note right of browser: The browser executes the javascript that renderers the notes again with the new note added - Note right of browser: The browser executes the callback function that renders the notes - ``` + + +``` -- GitLab