-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
20 lines (18 loc) · 763 Bytes
/
Copy pathserver.js
File metadata and controls
20 lines (18 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import app from './src/app.js'
// requisição http ( require / forma de import)
// const http = require('http')
//porta para listar o servidor
const port = process.env.PORT || 3300
//requisição http + create server : criar um server q vai usar a requisição (express)
// const server = http.createServer((req, res)=>{
// //req = requisição : parametro
// //res = resposta : parametro
// // res.writeHead(200, {'Content-type': 'text/plain'})
// // //WriteHeader = cabeçalho // 200: status da res // tipo da res (poderia ser JSON)
// // res.end(routes[req.url])
// // res final (end) - texto
// });
//listen - função para rodar o server na porta escolhida
app.listen(port, ()=>{
console.log(`server listen in: http://localhost:${port}`)
})