This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 512
London10_Afsha_Hossain_Node_Week1_quote-server #324
Open
Afsha10
wants to merge
10
commits into
CodeYourFuture:master
Choose a base branch
from
Afsha10:feature/quote-server-project
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
London10_Afsha_Hossain_Node_Week1_quote-server #324
Afsha10
wants to merge
10
commits into
CodeYourFuture:master
from
Afsha10:feature/quote-server-project
Commits on Jul 17, 2023
-
Level 1 Challenge - make the quote server
Added a /quotes route using Glitch and VS code: https://afsha1-quote-server.glitch.me/quotes localhost:3000/quotes Add a /quotes/random route using Glitch and VS code: https://afsha1-quote-server.glitch.me/quotes/random localhost:3000/quotes/random
Configuration menu - View commit details
-
Copy full SHA for d601292 - Browse repository at this point
Copy the full SHA d601292View commit details -
Level 2 Challenge - allow quote searches!
In this level of the challenge I have allowed the user of my quotes API to search my list of quotes. Added a /quotes/search?term route using Glitch and VS code: https://afsha1-quote-server.glitch.me/quotes/search?term=life https://afsha1-quote-server.glitch.me/quotes/search?term=success https://afsha1-quote-server.glitch.me/quotes/search?term=miss localhost:3000/quotes/search?term=life localhost:3000/quotes/search?term=success localhost:3000/quotes/search?term=miss
Configuration menu - View commit details
-
Copy full SHA for ad6c32e - Browse repository at this point
Copy the full SHA ad6c32eView commit details -
An intermediate step - echo the parameter
Making a simple test route that takes a query parameter and repeats the word back to the user. Tested: https://afsha1-quote-server.glitch.me/echo?word=ismail localhost:3000/echo?word=ismail
Configuration menu - View commit details
-
Copy full SHA for f449d27 - Browse repository at this point
Copy the full SHA f449d27View commit details
Commits on Jul 18, 2023
-
Challenge (Intermediate): Use a library to make random picking easier
Used a library called lodash to make it simpler to do tasks like picking randomly from an array. Tested: https://afsha1-quote-server.glitch.me/quotes/random localhost:3000/quotes/random To install the lodash library: - edited the file package.json... - added a line for lodash in the dependencies (we'll already see one for "express"). - We can use "*" as the version number for now. - If we're running locally, we will need to run npm install to set up the dependency. If we're using Glitch, it will automatically install it. - Added a "require" line in your server.js so that we can use the library. - const lodash = require('lodash'); then we can use use code inside the pickFromArray function lodash.sample(myArray)
Configuration menu - View commit details
-
Copy full SHA for 3779568 - Browse repository at this point
Copy the full SHA 3779568View commit details -
Challenge (Advanced): Add a React app as a front-end
- Made a very simple React app and named it quotes-react-app - Had it fetch a random quote from your server on glitch. We had to enable CORS on the express app. See below. We installed and enabled CORS in order to allow our JSON to be loaded from a different server (glitch.me) than our React app was initially loaded (probably netlify.com). in package.json added a dependency for "cors": "^2.8.5" Then in our server.js added... var cors = require('cors') and app.use(cors()) Then we host our react app on netlify
Configuration menu - View commit details
-
Copy full SHA for 0bfcb40 - Browse repository at this point
Copy the full SHA 0bfcb40View commit details -
Configuration menu - View commit details
-
Copy full SHA for 66be72b - Browse repository at this point
Copy the full SHA 66be72bView commit details -
Fix a bug in the search end point
Made sure the search term in the search end point is also case insensitive by adding .toLowerCase() to searchQuery.
Configuration menu - View commit details
-
Copy full SHA for ff33c6b - Browse repository at this point
Copy the full SHA ff33c6bView commit details
Commits on Jul 20, 2023
-
Ideas for further work: Use YOUR favourite quotes
Added my own theory and some of my favourite quotes by Nietzshe.
Configuration menu - View commit details
-
Copy full SHA for 4e027c9 - Browse repository at this point
Copy the full SHA 4e027c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68b1a9b - Browse repository at this point
Copy the full SHA 68b1a9bView commit details
Commits on Aug 25, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 9aef9f0 - Browse repository at this point
Copy the full SHA 9aef9f0View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.