Skip to content

Jguzaro2018017/entry-challenge#17

Open
jguzaro2018017 wants to merge 2 commits into
corecodeio:masterfrom
jguzaro2018017:jguzaro2018017/entry-challenge
Open

Jguzaro2018017/entry-challenge#17
jguzaro2018017 wants to merge 2 commits into
corecodeio:masterfrom
jguzaro2018017:jguzaro2018017/entry-challenge

Conversation

@jguzaro2018017
Copy link
Copy Markdown

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

Copy link
Copy Markdown

@JonathanL1ma JonathanL1ma left a 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. 😀

Comment thread src/index.ts
});

server.post("/", async (req: Request, res: Response) => {
server.post("/", async (req: express.Request, res: express.Response) => {
Copy link
Copy Markdown

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.

Comment thread src/data.ts
@@ -0,0 +1,31 @@
export const data = {
Copy link
Copy Markdown

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.

Comment thread src/client.ts
import { data } from "./data";

const axios = require('axios');
var contraseña = data.credentials.password;
Copy link
Copy Markdown

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.

Comment thread src/client.ts

}

async function guetData(){
Copy link
Copy Markdown

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.

Comment thread src/client.ts
Comment on lines +34 to +37




Copy link
Copy Markdown

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.

Comment thread src/client.ts
}

sendPost();
guetData();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo.

Comment thread src/client.ts
async function sendPost(){
let res = await axios.post('http://95.217.235.69/', data)
.then(function(response){
console.log(response);
Copy link
Copy Markdown

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.logs en el código.

Comment thread src/client.ts
}
})
.then(function(response){
console.log(response.data)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread package-lock.json
@@ -0,0 +1,297 @@
{
Copy link
Copy Markdown

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.

Comment thread src/data.ts
username: "jguzaro2018017",
},
credentials: {
password: "GuzaroTG2482",
Copy link
Copy Markdown

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.

Copy link
Copy Markdown

@netpoe netpoe left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants