Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ajv": "^6.12.2",
"axios": "^0.19.2",
"bcryptjs": "^2.4.3",
"dotenv": "^8.2.0",
Comment thread
saullopezc marked this conversation as resolved.
Outdated
"express": "^4.17.1",
"ts-node-dev": "^1.0.0-pre.44"
},
Expand Down
39 changes: 39 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { resolve } from 'path';
import {config} from 'dotenv';
import axios from 'axios'
import { datos } from './data'

Comment thread
saullopezc marked this conversation as resolved.
Outdated
config({path: resolve(__dirname, "./.env")});

const url = 'http://95.217.235.69/'

export const getInfo = async () => {
datos.credentials.password = process.env.PASSWORD
const urlString = url+datos.contactInfo.emailAddress

const data = await axios.get(urlString ,{
headers: {
"Content-Type": "application/json",
"x-password": datos.credentials.password
}
}).then(res => {
return res.data
}).catch(err => {
return err
})

return data
}

export const sendInfo = async () => {
datos.credentials.password = process.env.PASSWORD
const data = axios.post(url,datos).then(res => {
return (res.status, res.data)
}).catch(err => {
return err
})
return data
}

getInfo();
sendInfo();
30 changes: 30 additions & 0 deletions src/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const datos = {
contactInfo: {
fullName: "Danilo Antonio Solórzano Rodas",
emailAddress: "danilo_solorzano06@hotmail.com",
},
github: {
profileURL: "https://github.com/danbart",
username: "danbart",
},
credentials: {
password: "",
},
personalInfo: {
Comment thread
saullopezc marked this conversation as resolved.
Outdated
questions: [
{
question: "If I was a Sr. Programmer, I would like to build:",
answer: "Respuesta: Una plataforma educativa que ayude a las persones médiate interacciones a mejorar su ortografía de una forma divertida, que esta no sirva para corregir textos si no que la gente aprenda las reglas gramaticales y ortográficas.",
Comment thread
danbart marked this conversation as resolved.
Outdated
},
{
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: React.useEffect es un hook de react que es un efecto secundario que nos sirve para refrescar un parte del código cuando exista un cambio dentro de un estado. ",
Comment thread
saullopezc marked this conversation as resolved.
Outdated
},
{
question: "code is poetry, because:",
answer: "Respuesta: Los códigos son poesía por que son un conjunto de elementos que forman un lenguaje de programación siendo este una creación estética y artística.",
},
],
},
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ diff@^4.0.1:
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==

dotenv@^8.2.0:
Comment thread
saullopezc marked this conversation as resolved.
Outdated
version "8.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==

dynamic-dedupe@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz#06e44c223f5e4e94d78ef9db23a6515ce2f962a1"
Expand Down