sindresorhus /
ky
🌳 Tiny & elegant JavaScript HTTP client based on the Fetch API
93/100 healthLoading repository data…
Afreed78 / repository
Fetch: The fetch() API is used to make network requests in JavaScript, enabling you to retrieve resources like data from a server asynchronously. Routing: In web development, routing refers to navigating between different pages or components in an application, often implemented using libraries like React Router in single-page applications (SPAs).
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
In this project, let's perform Fetch and Routing by applying the concepts we have learned till now.
npm installnpm startThe app must have the following functionalities
When the app is opened, Home Route should be displayed
When the Home Route is opened,
When a blog item in Home Route is clicked,
/blogs/:idWhen the Blog Item Details Route is opened,
https://apis.ccbp.in/blogs/2blogsApiUrl
https://apis.ccbp.in/blogsGETReturns a response containing the list of all blogs
[
{
"id": 1,
"title": "React v16.9.0 and the Roadmap Update",
"image_url": "https://miro.medium.com/max/1050/1*i3hzpSEiEEMTuWIYviYweQ.png",
"avatar_url": "https://miro.medium.com/max/4096/1*wiOSfPd2sY0gXSNK9vv6bg.jpeg",
"author": "Dan Abramov,",
"topic": "React.js"
},
...
]
blogItemDetailsApiUrl
https://apis.ccbp.in/blogs/:idhttps://apis.ccbp.in/blogs/2GETReturns a response containing the details of the specific blog
{
"id": 2,
"title": "React v16.7: No, This Is Not the One With Hooks",
"image_url": "https://miro.medium.com/max/3158/1*kEPCQNY4dwVyaFuLEwJcNQ.png",
"avatar_url": "https://avatars.githubusercontent.com/u/3624098?v=4",
"author": "Andrew Clark",
"content": "React follows semantic versioning. Typically, this means that we use patch versions for bugfixes, and minors for new (non-breaking) features. However, we reserve the option to release minor versions even if they do not include new features. The motivation is to reserve patches for changes that have a very low chance of breaking. Patches are the most important type of release because they sometimes contain critical bugfixes.",
"topic": "React.js"
}
Use these files to complete the implementation:
src/App.jssrc/components/Home/index.jssrc/components/BlogList/index.jssrc/components/BlogList/index.csssrc/components/BlogItem/index.jssrc/components/BlogItem/index.csssrc/components/BlogItemDetails/index.jssrc/components/BlogItemDetails/index.cssThe following instructions are required for the tests to pass
Home route should consist of / in the URL path
About route should consist of /about in the URL path
Contact route should consist of /contact in the URL path
BlogItemDetails route should consist of /blogs/:id in the URL path
No need to use the BrowserRouter in App.js as we have already included in index.js file
Wrap the Loader component with an HTML container element and add the data-testid attribute value as loader to it as shown below
<div data-testid="loader">
<Loader type="TailSpin" color="#00bfff" height={50} width={50} />
</div>
Things to Keep in Mind
- All components you implement should go in the
src/componentsdirectory.- Don't change the component folder names as those are the files being imported into the tests.
- Do not remove the pre-filled code
- Want to quickly review some of the concepts you’ve been learning? Take a look at the Cheat Sheets.
Selected from shared topics, language and repository description—not editorial ratings.
sindresorhus /
🌳 Tiny & elegant JavaScript HTTP client based on the Fetch API
93/100 healthgraphql-hive /
🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.
91/100 healthjasonmayes /
Fetch your twitter posts without using the new Twitter 1.1 API. Pure JavaScript! By Jason Mayes
detectify /
Fetch web pages using headless Chrome, storing all fetched resources including JavaScript files. Run arbitrary JavaScript on many web pages and see the returned values
75/100 healthPolyfill for the AbortController DOM API and abortable fetch (stub that calls catch, doesn't actually abort request).
72/100 healthzellwk /
A library that makes the Fetch API a breeze
81/100 health