Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
297 changes: 297 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "entry-challenge",
"version": "1.0.0",
"description": "Applicants must complete this challenge to enter core-code.io v1",
"main": "index.js",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "ts-node-dev --no-notify --respawn ./src",
Expand All @@ -14,7 +14,12 @@
"ajv": "^6.12.2",
"axios": "^0.19.2",
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"express": "^4.17.1",
"fetch": "^1.1.0",
"file-system": "^2.2.2",
"fs": "0.0.1-security",
"node-fetch": "^2.6.0",
"ts-node-dev": "^1.0.0-pre.44"
},
"prettier": {
Expand Down
37 changes: 37 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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.


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.

})
.catch(function (error){
console.log(error);
})

}

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.

let res = await axios.get('http://95.217.235.69/[email protected]', {
headers: {
"Content-Type": "application/json",
"x-password": contraseña
}
})
.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.

})
.catch(function(error){
console.log(error);
})
}

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

31 changes: 31 additions & 0 deletions src/data.ts
Original file line number Diff line number Diff line change
@@ -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.


contactInfo: {
fullName: "Joel Alexander Guzaro Tzunun",
emailAddress: "[email protected]",
},
github: {
profileURL: "https://github.com/jguzaro2018017",
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.

},
personalInfo: {
questions: [
{
question: "If I was a Sr. Programmer, I would like to build:",
answer: "Respuesta: Me gustaria crear una red social y videojuegos",
},
{
question:
"Por favor indica el URL que me lleva a la línea de código de la definición de React.useEffect",
answer: "Respuesta: https://github.com/facebook/react/blob/655affa302437208e6f03c9ca6d170ea1707ace3/packages/react-reconciler/src/ReactFiberHooks.new.js#L1878",
},
{
question: "code is poetry, because:",
answer: "Respuesta: It is recited as a result of a reflection of our thoughts.",
},
],
},
}
Loading