-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
36 lines (27 loc) · 787 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// ROUTING PAGES
const express = require("express");
const axios = require("axios");
const app = express();
app.use('/',express.static("public"));
// redirect
app.get("/", (req, res) => {
res.redirect("/home");
});
// homepage
app.get("/home", (req, res) => {
res.sendFile(__dirname + "/public/homepage.html");
});
// cocktails page
app.get("/cocktails", (req, res) => {
res.sendFile(__dirname + "/public/cocktail.html");
});
// cocktails list page
app.get("/listcocktails", (req, res) => {
res.sendFile(__dirname + "/public/listcocktails.html");
});
// pagina non trovata
app.get("*", (req, res) => {
res.sendFile(__dirname + "/public/404.html");
});
app.listen(3000, () => console.log("listening -> port 3000"));
process.on('SIGUSR2', () => { process.exit(0); });