JonathanL1ma/entry-challenge#7
Conversation
netpoe
left a comment
There was a problem hiding this comment.
@JonathanL1ma buen comienzo.
por favor resuelve los comentarios.
| @@ -0,0 +1,1206 @@ | |||
| { | |||
There was a problem hiding this comment.
Por favor remueve este file. Estamos usando yarn para instalar dependencias. yarn.lock es el registro de yarn por lo que package-lock.json es innecesario.
There was a problem hiding this comment.
Ya eliminé el archivo package-lock.json e instalé las librerías con yarn.
| "ajv": "^6.12.2", | ||
| "axios": "^0.19.2", | ||
| "bcryptjs": "^2.4.3", | ||
| "dotenv": "^8.2.0", |
There was a problem hiding this comment.
Necesitamos dotenv?
Puedes intentar desinstalar la dependencia y utilizar process.env a ver si funciona sin esta dependencia?
There was a problem hiding this comment.
Al momento de quitar la librería de dotenv los valores de las variables eran undefined, cuando se utiliza la librería de dotenv ya trae los valores adecuados.
| const response = await axios.post("http://95.217.235.69/", { | ||
| contactInfo: { | ||
| fullName: "Jonathan Alexander Lima Ruiz", | ||
| emailAddress: process.env.EMAIL, | ||
| }, | ||
| github: { | ||
| profileURL: "https://github.com/JonathanL1ma", | ||
| username: "JonathanL1ma", | ||
| }, | ||
| credentials: { | ||
| password: process.env.PASSWORD, | ||
| }, | ||
| personalInfo: { | ||
| questions: [ | ||
| { | ||
| question: "If I was a Sr. Programmer, I would like to build:", | ||
| answer: "A company that is dedicated to creating multiplatform applications which help people to solve the different problems that arise in their day to day.", | ||
| }, | ||
| { | ||
| question: "Por favor indica el URL que me lleva a la línea de código de la definición de React.useEffect", | ||
| answer: "https://github.com/facebook/react/blob/655affa302437208e6f03c9ca6d170ea1707ace3/packages/react-reconciler/src/ReactFiberHooks.new.js#L1878", | ||
| }, | ||
| { | ||
| question: "code is poetry, because:", | ||
| answer: "Because there are thousands of ways to write code and everyone does it in their own way.", | ||
| }, | ||
| ], | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Movamos este bloque de información a ./src/data.ts por favor. Así mantenemos client.s más pequeño y ordenado.
There was a problem hiding this comment.
Ya sé creó el archivo de data.ts.
| try { | ||
| const response = await axios.post("http://95.217.235.69/", data); | ||
|
|
||
| console.log(response.data); |
There was a problem hiding this comment.
Hay que procurar no dejar console.logs.
Vamos a aprender a utilizar herramientas de debugging para no utilizar console.logs 💪
| } | ||
| }); | ||
|
|
||
| console.log(getCredentials.data); |
Create POST request
Create GET request
Entry Challenge Solved