diff --git a/.gitignore b/.gitignore index a91eeca..d9e0c83 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -.env - -/node_modules -/dist /data -src/client.ts \ No newline at end of file +/node_modules +/dist \ No newline at end of file diff --git a/src/client.ts b/src/client.ts new file mode 100644 index 0000000..bc6561f --- /dev/null +++ b/src/client.ts @@ -0,0 +1,44 @@ +import { request } from "http"; +import { data } from "./data"; + +async function sendInformation() { + const req = request( + { + host: "95.217.235.69", + port: "80", + path: "/", + method: "POST", + headers: { + "Content-Type": "application/json", + }, + }, + (response) => { + console.table(response.statusCode); + }, + ); + data.credentials.password = process.env.PASSWORD; + req.write(JSON.stringify(data)); + req.end(); +} + +async function showInformation() { + const req = request( + { + host: "95.217.235.69", + port: "80", + path: "/angelmrg2000@gmail.com", + method: "GET", + headers: { + "Content-Type": "application/json", + "x-password": process.env.PASSWORD, + }, + }, + (response) => { + console.log(response.statusCode); + }, + ); + req.end(); +} + +sendInformation(); +showInformation(); diff --git a/src/data.ts b/src/data.ts new file mode 100644 index 0000000..92a59d6 --- /dev/null +++ b/src/data.ts @@ -0,0 +1,36 @@ +const data = { + contactInfo: { + fullName: "Angel Miguel Reyes Guerrero", + emailAddress: "angelmrg2000@gmail.com", + }, + github: { + profileURL: "https://github.com/areyes2018391", + username: "areyes2018391", + }, + credentials: { + password: "", + }, + personalInfo: { + questions: [ + { + question: "If I was a Sr. Programmer, I would like to build:", + answer: + "Respuesta: If I would like to build a shopping app, because i could sell it and make money with it, also it would be a complex app", + }, + { + 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://github.com/facebook/react/blob/655affa302437208e6f03c9ca6d170ea1707ace3/packages/react-reconciler/src/ReactFiberHooks.new.js#L1878", + }, + { + question: "code is poetry, because:", + answer: + "Respuesta: Because the poetry is something that only the person that wrote it, can understand it at the perfection, and cause you can do anything what you want with it", + }, + ], + }, +}; + +export { data }; +