Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 13ee2bc5 authored by Martin Déclert's avatar Martin Déclert :cd:
Browse files

Amélioration de la gestion des vues

parent e3b8b3cb
No related branches found
No related tags found
No related merge requests found
......@@ -8,19 +8,19 @@ class Router {
return res.redirect('/hello')
})
this.router.get('/hello', async (req, res) => {
return res.render('views/base', { template: 'home' })
return res.render('base', { template: 'home' })
})
}
resume () {
this.router.get('/resume', async (req, res) => {
return res.render('views/base', { template: 'resume' })
return res.render('base', { template: 'resume' })
})
}
contact () {
this.router.get('/contact', async (req, res) => {
return res.render('views/base', { template: 'contact' })
return res.render('base', { template: 'contact' })
})
}
......
......@@ -18,7 +18,7 @@ class Server {
this.server.use(bodyParser.json())
this.server.use(express.static('www'))
this.server.set('view engine', 'ejs');
this.server.set('views', __dirname + '/www')
this.server.set('views', __dirname + '/www/views')
this.server.use(express.static(path.join(__dirname, 'www')))
this.server.use('/', this.router.listen())
......
......@@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Martin Déclert - Développeur web Back-end</title>
<link rel="stylesheet" href="skin/css/main.css">
<link rel="stylesheet" href="/skin/css/main.css">
</head>
<body class="<%- template %>-page">
......@@ -13,8 +13,8 @@
<%- include('pages/' + template) -%>
<%- include('pages/parts/footer') -%>
<script src="skin/js/node_modules/simple-parallax-js/dist/simpleParallax.min.js" type="application/javascript"></script>
<script src="skin/js/index.js" type="application/javascript"></script>
<script src="/skin/js/node_modules/simple-parallax-js/dist/simpleParallax.min.js" type="application/javascript"></script>
<script src="/skin/js/index.js" type="application/javascript"></script>
</body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment