From 507c22dfe650c77e3e77b2404f68907462c99cf3 Mon Sep 17 00:00:00 2001 From: Shrey Date: Fri, 20 Jul 2018 20:35:07 +0530 Subject: [PATCH] fix(challenges): glitch links in backend projects now open in new tabs ISSUES CLOSED: #17799 --- .../apis-and-microservices-projects.json | 78 ++++++++++++------- 1 file changed, 50 insertions(+), 28 deletions(-) diff --git a/challenges/05-apis-and-microservices/apis-and-microservices-projects.json b/challenges/05-apis-and-microservices/apis-and-microservices-projects.json index 3f810dba7..c2c201cf8 100644 --- a/challenges/05-apis-and-microservices/apis-and-microservices-projects.json +++ b/challenges/05-apis-and-microservices/apis-and-microservices-projects.json @@ -10,32 +10,44 @@ "description": [ "Build a full stack JavaScript app that is functionally similar to this: https://curse-arrow.glitch.me/.", "Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.", - "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" + "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" ], "tests": [ { - "text": "It should handle a valid date, and return the correct unix timestamp", - "testString": "getUserInput => $.get(getUserInput('url') + '/api/timestamp/2016-12-25').then(data => { assert.equal(data.unix, 1482624000000, 'Should be a valid unix timestamp'); }, xhr => { throw new Error(xhr.responseText); })" + "text": + "It should handle a valid date, and return the correct unix timestamp", + "testString": + "getUserInput => $.get(getUserInput('url') + '/api/timestamp/2016-12-25').then(data => { assert.equal(data.unix, 1482624000000, 'Should be a valid unix timestamp'); }, xhr => { throw new Error(xhr.responseText); })" }, { - "text": "It should handle a valid date, and return the correct UTC string", - "testString": "getUserInput => $.get(getUserInput('url')+ '/api/timestamp/2016-12-25').then(data => { assert.equal(data.utc, 'Sun, 25 Dec 2016 00:00:00 GMT', 'Should be a valid UTC date string'); }, xhr => { throw new Error(xhr.responseText); })" + "text": + "It should handle a valid date, and return the correct UTC string", + "testString": + "getUserInput => $.get(getUserInput('url')+ '/api/timestamp/2016-12-25').then(data => { assert.equal(data.utc, 'Sun, 25 Dec 2016 00:00:00 GMT', 'Should be a valid UTC date string'); }, xhr => { throw new Error(xhr.responseText); })" }, { - "text": "It should handle a valid unix date, and return the correct unix timestamp", - "testString": "getUserInput => $.get(getUserInput('url') + '/api/timestamp/1482624000000').then(data => { assert.equal(data.unix, 1482624000000) ; }, xhr => { throw new Error(xhr.responseText); })" + "text": + "It should handle a valid unix date, and return the correct unix timestamp", + "testString": + "getUserInput => $.get(getUserInput('url') + '/api/timestamp/1482624000000').then(data => { assert.equal(data.unix, 1482624000000) ; }, xhr => { throw new Error(xhr.responseText); })" }, { - "text": "It should return the expected error message for an invalid date", - "testString": "getUserInput => $.get(getUserInput('url') + '/api/timestamp/this-is-not-a-date').then(data => { assert.equal(data.error.toLowerCase(), 'invalid date');}, xhr => { throw new Error(xhr.responseText); })" + "text": + "It should return the expected error message for an invalid date", + "testString": + "getUserInput => $.get(getUserInput('url') + '/api/timestamp/this-is-not-a-date').then(data => { assert.equal(data.error.toLowerCase(), 'invalid date');}, xhr => { throw new Error(xhr.responseText); })" }, { - "text": "It should handle an empty date parameter, and return the current time in unix format", - "testString": "getUserInput => $.get(getUserInput('url') + '/api/timestamp').then(data => { var now = Date.now(); assert.approximately(data.unix, now, 20000) ;}, xhr => { throw new Error(xhr.responseText); })" + "text": + "It should handle an empty date parameter, and return the current time in unix format", + "testString": + "getUserInput => $.get(getUserInput('url') + '/api/timestamp').then(data => { var now = Date.now(); assert.approximately(data.unix, now, 20000) ;}, xhr => { throw new Error(xhr.responseText); })" }, { - "text": "It should handle an empty date parameter, and return the current time in UTC format", - "testString": "getUserInput => $.get(getUserInput('url') + '/api/timestamp').then(data => { var now = Date.now(); var serverTime = (new Date(data.utc)).getTime(); assert.approximately(serverTime, now, 20000) ;}, xhr => { throw new Error(xhr.responseText); })" + "text": + "It should handle an empty date parameter, and return the current time in UTC format", + "testString": + "getUserInput => $.get(getUserInput('url') + '/api/timestamp').then(data => { var now = Date.now(); var serverTime = (new Date(data.utc)).getTime(); assert.approximately(serverTime, now, 20000) ;}, xhr => { throw new Error(xhr.responseText); })" } ], "solutions": [], @@ -55,11 +67,12 @@ "description": [ "Build a full stack JavaScript app that is functionally similar to this: https://dandelion-roar.glitch.me/.", "Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.", - "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" + "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" ], "tests": [ { - "text": "I can get the IP address, language and operating system for my browser.", + "text": + "I can get the IP address, language and operating system for my browser.", "testString": "" } ], @@ -80,19 +93,22 @@ "description": [ "Build a full stack JavaScript app that is functionally similar to this: https://thread-paper.glitch.me/.", "Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.", - "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" + "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" ], "tests": [ { - "text": "I can pass a URL as a parameter and I will receive a shortened URL in the JSON response.", + "text": + "I can pass a URL as a parameter and I will receive a shortened URL in the JSON response.", "testString": "" }, { - "text": "If I pass an invalid URL that doesn't follow the valid http://www.example.com format, the JSON response will contain an error instead.", + "text": + "If I pass an invalid URL that doesn't follow the valid http://www.example.com format, the JSON response will contain an error instead.", "testString": "" }, { - "text": "When I visit that shortened URL, it will redirect me to my original link.", + "text": + "When I visit that shortened URL, it will redirect me to my original link.", "testString": "" } ], @@ -113,27 +129,32 @@ "description": [ "Build a full stack JavaScript app that is functionally similar to this: https://fuschia-custard.glitch.me/.", "Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.", - "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" + "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" ], "tests": [ { - "text": "I can create a user by posting form data username to /api/exercise/new-user and returned will be an object with username and _id.", + "text": + "I can create a user by posting form data username to /api/exercise/new-user and returned will be an object with username and _id.", "testString": "" }, { - "text": "I can get an array of all users by getting api/exercise/users with the same info as when creating a user.", + "text": + "I can get an array of all users by getting api/exercise/users with the same info as when creating a user.", "testString": "" }, { - "text": "I can add an exercise to any user by posting form data userId(_id), description, duration, and optionally date to /api/exercise/add. If no date supplied it will use current date. App will return the user object with the exercise fields added.", + "text": + "I can add an exercise to any user by posting form data userId(_id), description, duration, and optionally date to /api/exercise/add. If no date supplied it will use current date. App will return the user object with the exercise fields added.", "testString": "" }, { - "text": "I can retrieve a full exercise log of any user by getting /api/exercise/log with a parameter of userId(_id). App will return the user object with added array log and count (total exercise count).", + "text": + "I can retrieve a full exercise log of any user by getting /api/exercise/log with a parameter of userId(_id). App will return the user object with added array log and count (total exercise count).", "testString": "" }, { - "text": "I can retrieve part of the log of any user by also passing along optional parameters of from & to or limit. (Date format yyyy-mm-dd, limit = int)", + "text": + "I can retrieve part of the log of any user by also passing along optional parameters of from & to or limit. (Date format yyyy-mm-dd, limit = int)", "testString": "" } ], @@ -154,7 +175,7 @@ "description": [ "Build a full stack JavaScript app that is functionally similar to this: https://purple-paladin.glitch.me/.", "Working on this project will involve you writing your code on Glitch on our starter project. After completing this project you can copy your public glitch url (to the homepage of your app) into this screen to test it! Optionally you may choose to write your project on another platform but it must be publicly visible for our testing.", - "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" + "Start this project on Glitch using this link or clone this repository on GitHub! If you use Glitch, remember to save the link to your project somewhere safe!" ], "tests": [ { @@ -162,7 +183,8 @@ "testString": "" }, { - "text": "When I submit something, I will receive the file size in bytes within the JSON response.", + "text": + "When I submit something, I will receive the file size in bytes within the JSON response.", "testString": "" } ], @@ -178,4 +200,4 @@ } } ] -} \ No newline at end of file +}