Skip to content

Instantly share code, notes, and snippets.

@maylisdoucet
Last active March 14, 2018 08:59
Show Gist options
  • Save maylisdoucet/bbf008ddca0d4e84a1a3742a2010e192 to your computer and use it in GitHub Desktop.
Save maylisdoucet/bbf008ddca0d4e84a1a3742a2010e192 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<% include ../partials/head %><!--Cette balise appelle une section head indépendante dans mon dossier partials-->
</head>
<body class="container">
<header>
<% include ../partials/header %><!--Cette balise appelle une section header indépendante dans mon dossier partials-->
</header>
<main>
<div class="test">
<h2>About us</h2>
<p> Student in Wild Code School </p>
</div>
</main>
<footer>
<% include ../partials/footer %><!--Cette balise appelle un footer indépendant dans mon dossier partials-->
</footer>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<% include ../partials/head %><!--Cette balise appelle une section head indépendante dans mon dossier partials-->
</head>
<body class="container">
<header>
<% include ../partials/header %><!--Cette balise appelle une section header indépendante dans mon dossier partials-->
</header>
<main>
<div class="test">
<h2> Hello Wild Bordeaux </h2>
<p> Welcome herr ! </p>
</div>
</main>
<footer>
<% include ../partials/footer %><!--Cette balise appelle un footer indépendant dans mon dossier partials-->
</footer>
</body>
</html>
{
"name": "node-ejs",
"version": "1.0.0",
"main": "server.js",
"dependencies": {
"ejs": "^1.0.0",
"express": "^4.16.3"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"description": ""
}
// server.js
// load the things we need
var express = require('express');
var app = express();
// set the view engine to ejs
app.set('view engine', 'ejs');
// use res.render to load up an ejs view file
// index page
app.get('/', function(req, res) {
res.render('pages/index');
});
// about page
app.get('/about', function(req, res) {
res.render('pages/about');
});
app.listen(3000);
console.log('3000 is the magic port');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment