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:37] albert_palacios_jimenez [El servidor més simple] |
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, | ||
Línia 224: | Línia 231: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
- | |||
- | En aquest exemple | ||
\\ | \\ |