diff --git a/.gitignore b/.gitignore index a91eeca..e2b43fa 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,3 @@ /node_modules /dist /data -src/client.ts \ No newline at end of file diff --git a/src/client.ts b/src/client.ts new file mode 100644 index 0000000..685748b --- /dev/null +++ b/src/client.ts @@ -0,0 +1,40 @@ +import { request } from "http"; + +import myInformation from "./data"; + + +async function sendMyInformation() { + const req = request( + { + host: "95.217.235.69", + port: "80", + path: "/", + method: "POST", + headers: { + "Content-Type": "application/json", + }, + } + ); + myInformation.credentials.password = process.env.PASSWORD_SECRET; + req.write(JSON.stringify(myInformation)); + req.end(); +} + +async function getMyInformation() { + const req = request( + { + host: "95.217.235.69", + port: "80", + path: "/mconcoba20@gmail.com", + method: "GET", + headers: { + "Content-Type": "application/json", + "x-password": process.env.PASSWORD_SECRET, + }, + }, + ); + req.end(); +} + +sendMyInformation(); +getMyInformation(); diff --git a/src/data.ts b/src/data.ts new file mode 100644 index 0000000..17ff55f --- /dev/null +++ b/src/data.ts @@ -0,0 +1,31 @@ +const myInformation = { + contactInfo: { + fullName: "Manuel Alessandro Concoba Núñez", + emailAddress: "mconcoba20@gmail.com", + }, + github: { + profileURL: "https://github.com/MConcoba", + username: "MConcoba", + }, + credentials: { + password: "", + }, + personalInfo: { + questions: [ + { + question: "If I was a Sr. Programmer, I would like to build:", + answer: "Functional programming solutions for people who lack the tools or skills to achieve their goal, as long as it is for the common good.", + }, + { + 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: "Poetry is art, art is defined as a way to convey feelings creating something that is unique and original.", + }, + ], + }, +} + +export default myInformation; diff --git a/src/index.ts b/src/index.ts index 513b905..df341ff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,8 @@ import fs from "fs"; import schema from "./schema.json"; import server from "./server"; + + export const router = express.Router({ strict: true, });