{"id":18370056,"url":"https://github.com/lucas-duarte-dev/exercicios-node","last_synced_at":"2025-04-10T19:45:01.656Z","repository":{"id":113811244,"uuid":"356433068","full_name":"Lucas-Duarte-dev/Exercicios-node","owner":"Lucas-Duarte-dev","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-14T23:42:10.000Z","size":1885,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T20:57:14.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lucas-Duarte-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-10T00:53:20.000Z","updated_at":"2021-06-28T21:47:56.000Z","dependencies_parsed_at":"2023-11-26T16:31:23.836Z","dependency_job_id":null,"html_url":"https://github.com/Lucas-Duarte-dev/Exercicios-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-Duarte-dev%2FExercicios-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-Duarte-dev%2FExercicios-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-Duarte-dev%2FExercicios-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lucas-Duarte-dev%2FExercicios-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lucas-Duarte-dev","download_url":"https://codeload.github.com/Lucas-Duarte-dev/Exercicios-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281424,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:35:31.241Z","updated_at":"2025-04-10T19:45:01.622Z","avatar_url":"https://github.com/Lucas-Duarte-dev.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exercícios de Node\n\nNeste repositório irei colocar os exercícios do semestre referente a matéria de Técnicas de programação\n\n## Exercícios\n\n---\n\n- 1 - No serviço será configurado em um arquivo script.js para receber três valores: `numA, numB, opcao` . Sendo que `numA` e `numB` são os valores numéricos e `opcao` é a opção de operação aritmética.\n  Você terá que realizar o tratamento, apresentando apenas o resultado da operação solicitada pelo usuário (ou seja, não é para mostrar todas as operações aritméticas, apenas a escolhida pelo usuário).\n  Para que tenhamos o conceito de encapsulamento, as operações não devem ser escritas diretamente no arquivo script.js. Deste modo, crie um módulo que contenha as 4 operações aritméticas e importe este módulo no arquivo script.js.\n\n### Server\n\n```\nconst http = require(\"http\");\nconst url = require(\"url\");\nconst count = require(\"./calc\");\n\nhttp\n  .createServer((request, response) =\u003e {\n    response.writeHead(200, { \"Content-Type\": \"text/html; charset=utf-8\" });\n    const { option, first, last } = url.parse(request.url, true).query;\n\n    const value = count.calc(option, first, last);\n    const text = `O resultado da ${option} é ${value}`;\n\n    response.end(text);\n  })\n  .listen(3333);\n\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucas-duarte-dev%2Fexercicios-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucas-duarte-dev%2Fexercicios-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucas-duarte-dev%2Fexercicios-node/lists"}