-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
41 lines (29 loc) · 1.06 KB
/
index.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
36
37
38
39
40
41
const userController = require("./Controllers/UserController");
const path = require("path");
const Express = require("express");
const app = new Express();
var favicon = require('serve-favicon');
const sequelize = require("./config/database");
app.get("/user", userController.list);
app.get("/user/:id", userController.show);
app.use(Express.static(__dirname + "/site"));
app.get("/", function(req, res) {
res.sendFile(path.join(__dirname + "/site/accueil.html"));
});
app.get("/login", function(req, res) {
res.sendFile(path.join(__dirname + "/site/login.html"));
});
app.get("/parcours", function(req, res) {
res.sendFile(path.join(__dirname + "/site/parcours.html"));
});
app.get("/activites", function(req, res) {
res.sendFile(path.join(__dirname + "/site/activites.html"));
});
// for test purposes
app.get("/activite_exemple", function(req, res) {
res.sendFile(path.join(__dirname + "/site/activite_exemple.html"));
});
app.use(favicon(__dirname + "/site/favicon.ico"));
app.listen(8080, function() {
console.log("Example app listening on port 8080!");
});