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: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.env
.env.production

/node_modules
/dist
/data
src/client.ts
.idea
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
"author": "netpoe",
"license": "ISC",
"dependencies": {
"@types/dotenv": "^8.2.0",
"ajv": "^6.12.2",
"axios": "^0.19.2",
"bcryptjs": "^2.4.3",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"ts-node-dev": "^1.0.0-pre.44"
},
Expand All @@ -24,6 +26,7 @@
"devDependencies": {
"@types/axios": "^0.14.0",
"@types/node": "^14.0.13",
"prettier": "^2.0.5",
"typescript": "^3.9.5"
}
}
33 changes: 33 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import axios from "axios";
import { data } from "./data";

postData();
getData();

async function postData() {
axios
.post("http://95.217.235.69/", data)
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
}

async function getData() {
const URL = "http://95.217.235.69/";
axios
.get(URL + data.contactInfo.emailAddress, {
headers: {
"x-password": data.credentials.password,
"Content-Type": "application/json",
},
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
}
34 changes: 34 additions & 0 deletions src/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { PASSWORD_ENV } from "./utils/config";

export const data = {
contactInfo: {
fullName: "Jimmy Ottoniel Gabriel Roquel",
emailAddress: "jimmyottonielgr@gmail.com",
},
github: {
profileURL: "https://github.com/Jimmygabriel",
username: "Jimmygabriel",
},
credentials: {
password: `${PASSWORD_ENV}`,
},
personalInfo: {
questions: [
{
question: "If I was a Sr. Programmer, I would like to build:",
answer: "Reverse engineering tool development :'D",
},
{
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:
"The overflow of the soul, a lucid dream, the spirit of the developer. Of what is not yet, but already is, before it was.",
},
],
},
};
7 changes: 7 additions & 0 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as dotenv from "dotenv";

dotenv.config();
let path = `${__dirname}/../../.env`;
dotenv.config({ path: path });

export const PASSWORD_ENV = process.env.PASSWORD_ENV;