This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let city = `Bordeaux` | |
let age = `29` | |
const dateOfBirth = `1988` | |
console.log (`J'habite ${city}, j'ai ${age} ans et je suis née en ${dateOfBirth}`); | |
/* CHALLENGE ES6 | |
Profil utilisateur | |
Imaginez que vous construisez une application pour gérer le profil d'un utilisateur. Un profil peut avoir une 'city' (qui peut changer), 'age' (qui change tous les ans) et 'dateOfBirth' (qui ne change pas). | |
Déclarer trois variables avec ces mêmes noms puis une quatrième variable nommée sentence qui concatène l'ensemble des variables ville, age et date de naissance dans une jolie phrase. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const profile = { | |
name: 'Alex', | |
getName (){ | |
return this.name; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cowsay = require("cowsay"); | |
console.log(cowsay.say({ | |
text : "Hello Boy", | |
e : "oO", | |
T : "U " | |
})); | |
// or cowsay.think() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
/* "Réponse Hey ! It's a get cool" sur la page d'accueil qui correspond à la route (/users/. | |
Correspondance POSTMAN : http://127.0.0.1:3000/users/ */ | |
router.get('/', function(req, res, next) { | |
res.send('Hey ! It\'s a GET cool '); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends layout.pug | |
block content | |
p Say Hello | |
include header.pug | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MySQL dump 10.13 Distrib 5.7.21, for macos10.13 (x86_64) | |
-- | |
-- Host: localhost Database: test | |
-- ------------------------------------------------------ | |
-- Server version 5.7.21 | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
/* Récupération du paramètre d'URL + du level. | |
http://localhost:3000/forms-101?level=easy | |
doc req.params : http://expressjs.com/fr/api.html#req.params | |
doc req.query : http://expressjs.com/fr/api.html#req.query | |
*/ | |
router.get('/forms-:numeroForm(\\d+)', (req, res) => { |