-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jguzaro2018017/entry-challenge #17
base: master
Are you sure you want to change the base?
Jguzaro2018017/entry-challenge #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Buen comienzo, soluciona los comentarios de aquí abajo. 😀
@@ -55,7 +55,7 @@ server.get("/:emailAddress", async (req: Request, res: Response) => { | |||
} | |||
}); | |||
|
|||
server.post("/", async (req: Request, res: Response) => { | |||
server.post("/", async (req: express.Request, res: express.Response) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No se tiene que modificar nada en este archivo.
@@ -0,0 +1,31 @@ | |||
export const data = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deberías de instalar Prettier
en tu editor, está te autoidenta tu código y quedará mas legible.
import { data } from "./data"; | ||
|
||
const axios = require('axios'); | ||
var contraseña = data.credentials.password; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Una buena práctica al momento de programar es escribirlo en inglés, además que escribirlo en español con carácteres especiales como lo es la ñ te podría generar incovenientes.
|
||
} | ||
|
||
async function guetData(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
El nombre de está función contiene un typo
, esto quiere decir que posees un error de escritura, la palabra correcta sería get
.
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cuándo instales Prettier
he identes tu código estas líneas innecesarias desaparecerán.
} | ||
|
||
sendPost(); | ||
guetData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
.
async function sendPost(){ | ||
let res = await axios.post('http://95.217.235.69/', data) | ||
.then(function(response){ | ||
console.log(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No se tienen que dejar console.log
s en el código.
} | ||
}) | ||
.then(function(response){ | ||
console.log(response.data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌
@@ -0,0 +1,297 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Estamos utilizando yarn
para instalar las dependencias, así que tienes que borrar este archivo, al momento de instalar nuevamente las dependencias con yarn
se autogenera un archivo yarn.lock
, ese es el que debes de subir.
username: "jguzaro2018017", | ||
}, | ||
credentials: { | ||
password: "GuzaroTG2482", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Está información es privada, por lo que debes de buscar una manera para introducir está información de una manera indirecta.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gracias por tus comentarios @JonathanL1ma
@jguzaro2018017 quedamos en espera de tus actualizaciones.
Se modifico la extensión de index.js a index.ts en el archivo package.json
Se creo el archivo client.ts quien era el encargado de realizar las solicitudes POST & GET
Se creo el archivo data.ts en el cual iban los datos a enviar
Se instalaron las dependencias faltantes y se modifico el archivo index.ts