Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
| Ambdós costats versió prèvia Revisió prèvia Següent revisió | Revisió prèvia | ||
|
nodejs_express [2022/09/09 12:39] albert_palacios_jimenez [Agafant paràmetres de la URL (Objecte 'req')] |
nodejs_express [2022/09/16 03:11] (actual) albert_palacios_jimenez [Configurant una carpeta d'arxiu estàtics] |
||
|---|---|---|---|
| Línia 88: | Línia 88: | ||
| const port = 3000 | const port = 3000 | ||
| - | app.get('/', | + | app.get('/', |
| - | | + | async function getHello |
| - | }) | + | res.send(`Hello World`) |
| + | } | ||
| app.listen(port, | app.listen(port, | ||
| Línia 118: | Línia 119: | ||
| const port = 3000 | const port = 3000 | ||
| - | app.get('/ | + | app.get('/ |
| - | res.send('Llista de clients') | + | async function getClients |
| - | }) | + | res.send(`Llista de clients`) |
| + | } | ||
| - | app.get('/ | + | app.get('/ |
| - | res.send('Entra al sistema') | + | async function getLogin |
| - | }) | + | res.send(`Entra al sistema`) |
| + | } | ||
| - | app.get('/', | + | app.get('/', |
| - | | + | async function getHello |
| - | }) | + | res.send(`Hello World`) |
| + | } | ||
| app.listen(port, | app.listen(port, | ||
| Línia 163: | Línia 167: | ||
| app.use(express.static(' | app.use(express.static(' | ||
| - | app.get('/ | + | app.get('/ |
| - | res.send('Llista de clients') | + | async function getClients |
| - | }) | + | res.send(`Llista de clients`) |
| + | } | ||
| - | app.get('/ | + | app.get('/ |
| - | res.send('Entra al sistema') | + | async function getLogin |
| - | }) | + | res.send(`Entra al sistema`) |
| + | } | ||
| - | app.get('/', | + | app.get('/', |
| - | | + | async function getHello |
| - | }) | + | res.send(`Hello World`) |
| + | } | ||
| app.listen(port, | app.listen(port, | ||