Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jguzaro2018017
Copy link

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

@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. 😀

@@ -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) => {

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 = {

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;

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(){

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 on lines +34 to +37




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();

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);

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.

}
})
.then(function(response){
console.log(response.data)

Choose a reason for hiding this comment

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

@@ -0,0 +1,297 @@
{

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",

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

@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