Skip to content
This repository has been archived by the owner on May 15, 2022. It is now read-only.

Commit

Permalink
Atualizados EX Dia 57
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarcon83 committed Apr 20, 2021
1 parent 9abe5a6 commit 3843230
Show file tree
Hide file tree
Showing 7 changed files with 917 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/Outros/
/Projetos Dos Módulos/
/ZZZ Modelo/
*/node_modules/
node_modules/
/React Dia 6 - Recriando Site/src/font/
s.js
teste.js
Expand Down
15 changes: 15 additions & 0 deletions Dia 57 - Node - Introdução/Node Test/index NODE.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Carrega o modulo HTTP do Node
var http = require("http");

// Cria um servidor HTTP e uma escuta de requisições para a porta 8000
http.createServer((request, response) => {

// Configura o cabeçalho da resposta com um status HTTP e um Tipo de Conteúdo
response.writeHead(200, {'Content-Type': 'text/plain'});

// Manda o corpo da resposta "Olá Mundo"
response.end('Ola Mundo\n');
}).listen(8000, '127.0.0.1');

// Imprime no console a URL de acesso ao servidor
console.log('Servidor executando em http://127.0.0.1:8000/');
19 changes: 19 additions & 0 deletions Dia 57 - Node - Introdução/Node Test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// O require importa o modulo
const express = require("express")
const app = express();


// Rotas

// Define o que acontece na root
app.get("/", (req, res) => {
// Resposta da rota
res.end('Ola Mundo\n');
})

// Serve a pasta public para quem acessa o servidor
//app.use(express.static("public"));


// Inicia o Servidor na porta 8000
app.listen(8000, () => (console.log("Funcionando na porta 8000")))
Loading

0 comments on commit 3843230

Please sign in to comment.