Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
.old/D/remote -clipboard has done
remote clipboard completed
  • Loading branch information
murselaysan committed Jul 29, 2020
commit e7fd5e82f3b3e8b4d744ef6af99575546ede3895
12 changes: 7 additions & 5 deletions Week-3/.old/InClass/D-remote-clipboard/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Also, for GET request, you can use the url directly in your browser address bar
// Task 1: create a new clipboard
// Complete the code below

var clipboardTitle = "CHANGE ME";
var clipboardText = "CHANGE ME";
var clipboardTitle = "Birmingham";
var clipboardText = "I am from Birminghammmm";
var requestBody = { title: clipboardTitle, text: clipboardText };

var postRequestParameters = {
Expand All @@ -32,12 +32,14 @@ var postRequestParameters = {
}
};

fetch(/* Write the API address here */, postRequestParameters);
fetch('https://codeyourfuture.herokuapp.com/api/clipboard', postRequestParameters);


// Task 2: Load an existing clipboard
// Add your code below

fetch(/* ... */).then(function(response) {
fetch('https://codeyourfuture.herokuapp.com/api/clipboard?title=Birmingham').then(function(response) {
return response.text();
}).then(/* ... */);
}).then(function(result){
console.log(result)
});