gustiti03 / nodejs-quarta

0 stars 0 forks source link

30/10 #4

Open gustiti03 opened 4 weeks ago

gustiti03 commented 4 weeks ago

Código NODEJS:

import express from 'express'; import path from 'path';

const app = express(); const port = 5000

app.use(express.urlencoded({ extended: true}))

app.get('/', function(req, res){ const root = path.resolve("./index.html") res.sendFile(root) })

app.post("/login", function(req, res ){ console.log(req.body) })

app.listen(port, function() { console.log("Estou online") })