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
/variables.env
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Applicants must complete this challenge to enter core-code.io v1",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "ts-node-dev --no-notify --respawn ./src/client",
"start": "ts-node-dev --no-notify --respawn ./src",
"start:debug": "ts-node-dev --inspect --no-notify --respawn ./src"
},
Expand All @@ -14,6 +14,7 @@
"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 @@ -26,4 +27,4 @@
"@types/node": "^14.0.13",
"typescript": "^3.9.5"
}
}
}
36 changes: 36 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import axios from "axios";
import dotenv from "dotenv";
dotenv.config({ path: "variables.env" });
import data from "./data";
import server from "./server";

const url = "http://95.217.235.69/";

server.post("/sendInformation", async (req, res) => {
try {
let result = await axios.post(url, data);
res.json(result.data);
} catch (error) {
return error;
}
});

server.get("/getKey/:email", async (req, res) => {
try {
let endpoint = url + req.params.email;
let options = {
headers: {
"x-password": process.env.PASS,
"Content-Type": "application/json",
},
};
let result = await axios.get(endpoint, options);
res.json(result.data);
} catch (error) {
return error;
}
});

server.listen("8081", () => {
console.log("listening 8081");
});
34 changes: 34 additions & 0 deletions src/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const data = {
contactInfo: {
fullName: "Oscar Enrique Muñoz Lima",
emailAddress: "cok.kike@gmail.com",
},
github: {
profileURL: "https://github.com/cokkike88",
username: "cokkike88",
},
credentials: {
password: process.env.PASS,
},
personalInfo: {
questions: [
{
question: "If I was a Sr. Programmer, I would like to build:",
answer:
"Respuesta: Some application with microservices with aws lambda, with neptuno database, nodejs as backend, reactjs as frontend, aws cognito for authentication and authorization, aws s3 to resources storage, aws api gateway",
},
{
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://es.reactjs.org/docs/hooks-reference.html#useeffect",
},
{
question: "code is poetry, because:",
answer:
"Respuesta: Because we can build anything that we want and we can do that the world change.",
},
],
},
};

export default data;
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:
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