forkify | This was the final project | Learning library
kandi X-RAY | forkify Summary
kandi X-RAY | forkify Summary
This was the final project as part of a Udemy course - The Complete JavaScript Course 2020. Forkify is a recipe finding web application which uses data from the Forkify API. While it is a fairly basic web application, it can be used as a guide to cook one's favorite dish. Beyond accessing recipes from different sources online, it also provides information on the number and amount of ingredients needed to build a specific dish according to the number of people to serve. This project was my first real delve into JavaScript and Web Development.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- return exports object
- Return the integer corresponding to the specified time
- inlined down function
- Function that checks to see if it is less than 1 .
- 15 . 4
- get 5 bit integers
- this function is used for other words
- helper functions
- inbound code
- this is a complex
forkify Key Features
forkify Examples and Code Snippets
Community Discussions
Trending Discussions on forkify
QUESTION
I'm making a recipe search application using forkify API. I get such json (let's take pizza recipes for example). I've made a recycler and searchable, but the recipes themselves are given as a link to the site with that recipe (see source_url in the json). I've made a webview for this, but there's one problem. I need to get that source_url and have it match the recipe I clicked on. I tried to make an additional element in resycler, small invisible textview, and put source_url there, so when I clicked on it, it would take text and pass it to a variable and load it as url into webview. (Very silly solution, but I didn't think of another one.) It's not what I had in mind. Basically my code works, but the url is not passed from all textViews. I've been observing its behaviour and I can only assume that it loads every 4 in vertical mode and every 2 in horizontal mode. And this is not what I need. Please help me to solve this problem. Below is my code:
Adapter:
...ANSWER
Answered 2022-Mar-12 at 15:51Please make little bit change to make adapter like that way read most of comment , RecyclerView itemClickListener in Kotlin
create callback listener and return url in main activity
QUESTION
So I'm trying to export/import script from model.js and I use this
...ANSWER
Answered 2021-Dec-12 at 14:29export const state = {
recipe: {},
};
console.log(state.recipe);
export const loadRecipe = async function (id) {
try {
const res = await fetch(
`https://forkify-api.herokuapp.com/api/v2/recipes/${id}`
);
const data = await res.json();
if (!res.ok) throw new Error(`${data.message} (${res.status})`);
console.log(data);
state.recipe = data.data.recipe;
console.log(recipe);
} catch (err) {
console.error(err);
}
};
QUESTION
Every time I try to run npm start
or npm build
I get an error saying unknown: Entry /mnt/c/Users/kabre/Desktop/18-forkify/index.html does not exist
. I got told that Parcel might be automatically renaming my index.html. Not sure how to go on about fixing this since I'm just starting out learning Parcel/npm.
ANSWER
Answered 2021-Aug-31 at 17:20Try this:
- Run npm init -y in your project
- Install parcel in your project: npm install parcel-bundler --save-dev
- Put this in your package.json:
QUESTION
I have a project in JavaScript that works with parcel 2 bundler just fine on Windows. But when I try to run the same code in Ubuntu, it does not work and gives errors. Here I am giving the error and the package.json. I have searched many places and tried many solutions like cleaning the cache and reinstalling but they did not help. As I said this works in Windows.
Error that I got when I try to run npm run dev
ANSWER
Answered 2021-Aug-16 at 21:09I figured out the problem. I had installed the npm and the node via apt. And the nodejs version installed was 10.19.0. But actually the newest version in the node js website is 14.17.5. So I downloaded the source code from the website, built it myself and installed it with make. Then it worked.
QUESTION
I want the logo png file to display
The image is supposed to load once the web pack is started right now I can only get the HTML, css, and some fonts while the logo does not display.
Error messages
...ANSWER
Answered 2021-Feb-09 at 13:56I think, you missed in your webpack.config.json under rules outputPath like after test: /.(png|.... than define loader: 'file-loader', and insert path: options: { outputPath: 'images', } For me, it is easier with copy-webpack-plugin than you can copy files in your dist..
QUESTION
This is more of a curiosity question and I feel that it would be useful to know why, but can anyone explain why console.log(recipe) prints twice. When I click Search button the results prints twice in the console. I think i has to do with react re-rendering the component twice, can this be explained in detail.
...ANSWER
Answered 2020-Aug-12 at 20:21Ciao, I'm not the maximum expert of react, but you could do a test. You know that useEffect
hook is triggered every time component is re-rendered. So you could put your console.log in useEffect and see if will be logged twice. Something like:
QUESTION
I'm trying to follow a tutorial non javascript, so I'm trying to run webpack from node script but I've been getting this weird error, I've searched online but couldn't find the solution
the error: C:\Users\Ahmad Usman\Desktop\9-forkify\webpack.config.js:2 const path = require("path"); ^
below is the code (they are in different files though)
...ANSWER
Answered 2020-Aug-06 at 04:34The error says :
QUESTION
I am building sample recipe app named : Forkify in which i am using javascript,npm,babel,webpack and i am using custom API to fetch the data.
API URL
https://forkify-api.herokuapp.com/
Search Example
https://forkify-api.herokuapp.com/api/search?q=pizza
Get Example
https://forkify-api.herokuapp.com/api/get?rId=47746
The thing it displays the recipe items on the screen with the required ingredients for that particular recipe , also there are two buttons + and - which are used to add servings and on basis of that the serving size and required ingredients changes.
Below are the screenshots and code files for better understanding :
index.js
...ANSWER
Answered 2020-Jul-22 at 12:36i found the solution , the problem was in Recipe.js file : last part where updateServings(type) method was declared. Previously in that method i wrote
QUESTION
I am building sample recipe app named Forkify in which i am using javascript,npm,babel,webpack and using custom API to fetch the data.
API URL : https://forkify-api.herokuapp.com/
Search Example : https://forkify-api.herokuapp.com/api/search?q=pizza
Get Example : https://forkify-api.herokuapp.com/api/get?rId=47746
When i run the project and on landing screen when i enter query to search recipe for example : pizza , then although i get the results , but the part which must show the ingredients of particular recipe is showing undefined.
Below are the code files and screenshots of the project :
index.js
...ANSWER
Answered 2020-Jul-21 at 13:30When you try to parse the ingredients into an object you never return the object you've build, but instead return a half parsed string.
QUESTION
I am building a sample recipe app named : Forkify using Javascript,NPM,Babel and Webpack in which i am using custom API
API URL : forkify-api.herokuapp.com
TO SEARCH RESULT
Returns a list of recipes for a specific query
Path: https://forkify-api.herokuapp.com/api/search
Example URL: https://forkify-api.herokuapp.com/api/search?q=pizza
GET
Returns the details about a specific recipe
Path: https://forkify-api.herokuapp.com/api/get
Example URL: https://forkify-api.herokuapp.com/api/get?rId=47746
When i run project in command line using command npm start run and when i input query pizza in search box, i get the following error ( image attached )
Below are the code files :
index.js
...ANSWER
Answered 2020-Jul-20 at 09:54You are missing the await
keyword from your axios
call in Search.js:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install forkify
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page