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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

/node_modules
/dist
/data
src/client.ts
/data
2 changes: 2 additions & 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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Necesitamos dotenv?
Puedes intentar desinstalar la dependencia y utilizar process.env a ver si funciona sin esta dependencia?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Al momento de quitar la librería de dotenv los valores de las variables eran undefined, cuando se utiliza la librería de dotenv ya trae los valores adecuados.

"express": "^4.17.1",
"ts-node-dev": "^1.0.0-pre.44"
},
Expand All @@ -23,6 +24,7 @@
},
"devDependencies": {
"@types/axios": "^0.14.0",
"@types/dotenv": "^8.2.0",
"@types/node": "^14.0.13",
"typescript": "^3.9.5"
}
Expand Down
23 changes: 23 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { default as axios } from "axios";

import { data } from "./data";

const accessTest = async () => {
try {
const response = await axios.post("http://95.217.235.69/", data);
if (response.status === 200) {
await axios.get(`http://95.217.235.69/${process.env.EMAIL}`, {
headers: {
"Content-Type": "application/json",
"x-password": process.env.PASSWORD,
},
});
} else {
throw new Error("Response Failed");
}
} catch (error) {
console.error(error);
}
};

accessTest();
37 changes: 37 additions & 0 deletions src/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as dotenv from 'dotenv';

dotenv.config();

export const data = {
contactInfo: {
fullName: "Jonathan Alexander Lima Ruiz",
emailAddress: process.env.EMAIL,
},
github: {
profileURL: "https://github.com/JonathanL1ma",
username: "JonathanL1ma",
},
credentials: {
password: process.env.PASSWORD,
},
personalInfo: {
questions: [
{
question: "If I was a Sr. Programmer, I would like to build:",
answer:
"A company that is dedicated to creating multiplatform applications which help people to solve the different problems that arise in their day to day.",
},
{
question:
"Por favor indica el URL que me lleva a la línea de código de la definición de React.useEffect",
answer:
"https://github.com/facebook/react/blob/655affa302437208e6f03c9ca6d170ea1707ace3/packages/react-reconciler/src/ReactFiberHooks.new.js#L1878",
},
{
question: "code is poetry, because:",
answer:
"Because there are thousands of ways to write code and everyone does it in their own way.",
},
],
},
};
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
dependencies:
axios "*"

"@types/dotenv@^8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@types/dotenv/-/dotenv-8.2.0.tgz#5cd64710c3c98e82d9d15844375a33bf1b45d053"
integrity sha512-ylSC9GhfRH7m1EUXBXofhgx4lUWmFeQDINW5oLuS+gxWdfUeW4zJdeVTYVkexEW+e2VUvlZR2kGnGGipAWR7kw==
dependencies:
dotenv "*"

"@types/node@^14.0.13":
version "14.0.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.13.tgz#ee1128e881b874c371374c1f72201893616417c9"
Expand Down Expand Up @@ -202,6 +209,11 @@ diff@^4.0.1:
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==

dotenv@*, dotenv@^8.2.0:
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