Archived
1
0
Fork 0

Add routes

This commit is contained in:
Ethanell 2020-05-29 12:55:56 +02:00
parent 1690e70cc1
commit d95a0e9918
13 changed files with 80 additions and 32 deletions

10
app.js
View file

@ -5,6 +5,11 @@ const cookieParser = require("cookie-parser");
const logger = require("morgan");
const indexRouter = require("./routes/index");
const loginRouter = require("./routes/login")
const logoutRouter = require("./routes/logout")
const commandsRouter = require("./routes/commands")
const kitchenRouter = require("./routes/kitchen")
const stocksRouter = require("./routes/stocks")
const app = express();
@ -19,6 +24,11 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, "public")));
app.use("/", indexRouter);
app.use("/login", loginRouter);
app.use("/logout", logoutRouter);
app.use("/commands", commandsRouter);
app.use("/kitchen", kitchenRouter);
app.use("/stocks", stocksRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {

View file

@ -13,7 +13,7 @@
"morgan": "~1.9.1",
"pg": "^8.2.1",
"pg-hstore": "^2.3.3",
"pug": "2.0.0-beta11",
"pug": "^2.0.0-beta11",
"sequelize": "^5.21.11",
"sequelize-cli": "^5.5.1",
"socket.io": "^2.3.0"

9
routes/commands.js Normal file
View file

@ -0,0 +1,9 @@
const express = require("express");
const router = express.Router();
/* GET home page. */
router.get("/", function(req, res) {
res.render("commands", { title: "Kfet - Commands" });
});
module.exports = router;

View file

@ -2,8 +2,8 @@ const express = require("express");
const router = express.Router();
/* GET home page. */
router.get("/", function(req, res, next) {
res.render("index", { title: "Express" });
router.get("/", function(req, res) {
res.render("index", { title: "Kfet" });
});
module.exports = router;

9
routes/kitchen.js Normal file
View file

@ -0,0 +1,9 @@
const express = require("express");
const router = express.Router();
/* GET home page. */
router.get("/", function(req, res) {
res.render("kitchen", { title: "Kfet - Kitchen" });
});
module.exports = router;

9
routes/login.js Normal file
View file

@ -0,0 +1,9 @@
const express = require("express");
const router = express.Router();
/* GET home page. */
router.get("/", function(req, res) {
res.render("login", { title: "Kfet - Login" });
});
module.exports = router;

9
routes/logout.js Normal file
View file

@ -0,0 +1,9 @@
const express = require("express");
const router = express.Router();
/* GET home page. */
router.get("/", function(req, res) {
res.send("Ok");
});
module.exports = router;

9
routes/stocks.js Normal file
View file

@ -0,0 +1,9 @@
const express = require("express");
const router = express.Router();
/* GET home page. */
router.get("/", function(req, res) {
res.render("stocks", { title: "Kfet - Stocks" });
});
module.exports = router;

View file

@ -25,7 +25,7 @@ block content
a(href="/logout")
button.contact2-form-btn Logout
div.bg-contact2#main-container(style="background-image: /images/bg-01.jpg;")
div#main-container.bg-contact2(style="background-image: url(/images/bg-01.jpg);height: 93vh")
form.container(action="#")
div#dish
h1 Dish

View file

@ -1,7 +1,7 @@
extends layout
block content
div#main-container.bg-contact2(style="background-image: /images/bgcuisine.png")
div#main-container.bg-contact2(style="background-image: url(/images/bgcuisine.png)")
div#middle-container
div#WIP
div#waiting

View file

@ -1,31 +1,24 @@
extends layout
block content
div.bg-contact2(style="background-image: /images/bg-01.jpg")
div.bg-contact2(style="background-image: url(/images/bg-01.jpg);")
div.container-contact2
div.wrap-contact2
span.contact2-form-title Login
p Kfet member:
form(action="" method="post" novalidate)
div.wrap-input2.validate-input(data-validate="Username is required")
input.input2(type="text" name="name")
span.focus-input2(data-placeholder="Username")
div.wrap-input2.validate-input(data-validate="Password required")
input.input2(type="password" name="password")
span.focus-input2(data-placeholder="Password")
div#fct
input#commi(type="radio" name="dct")
label(for="commi") Commi
input#pc(type="radio" name="fct")
label(for="pc") PC
input#guest(type="radio" name fct)
label(for="guest") Guest
div.contact2-form-btn
div.wrap-contact2-form-btn
button.contact2-form-btn(type="submit") Login
div.wrap-input2.validate-input(data-validate="Username is required")
input.input2(type="text" name="name")
span.focus-input2(data-placeholder="Username")
div.wrap-input2.validate-input(data-validate="Password invalid")
input.input2(type="password" name="password")
span.focus-input2(data-placeholder="Mot de passe")
div#fct
input#commi(type="radio" name="fct")
label(for="commi") Commi
input#pc(type="radio" name="fct")
label(for="pc") PC
input#guest(type="radio" name="fct")
label(for="guest") Guest
div.container-contact2-form-btn
div.wrap-contact2-form-btn
div.contact2-form-bgbtn
button.contact2-form-btn(type="submit") Login

View file

@ -6,7 +6,7 @@ block content
a#gobackpc(onclick="window.close()")
li Back to commands
div#main-container.bg-contact2(style="background-image: /images/bg-01.jpg")
div#main-container.bg-contact2(style="background-image: url(/images/bg-01.jpg)")
form#stocks.container(action="#")
div#teams
div#sandwich

View file

@ -1,7 +1,7 @@
extends layout
block content
div#main-container.bg-contact2(stype="background-image: /images/bg-01.jpg")
div#main-container.bg-contact2(style="background-image: url(/images/bg-01.jpg);")
form#stocks.container(action="#")
div#dish
h1 Dishes