This file contains hidden or 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
### **Les notions abordées que j'avais déjà comprises :** | |
- [x] créer un composant | |
- [x] import | |
- [x] créer un projet avec Yarn | |
- [x] export default | |
### **Les notions abordées que j'ai comprises :** | |
- [x] props |
This file contains hidden or 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 mysql = require('mysql'); | |
const connection = mysql.createConnection({ | |
host: 'localhost', // adresse du serveur | |
user: 'root', // le nom d'utilisateur | |
password: 'jecode4wcs', // le mot de passe | |
database: 'filRouge', // le nom de la base de données | |
}); | |
module.exports = connection; |
This file contains hidden or 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> SELECT name, COUNT(*) AS player FROM team JOIN player ON player.team_id=team.id GROUP BY team_id ORDER BY player ASC; | |
+------------+--------+ | |
| name | player | | |
+------------+--------+ | |
| Hufflepuff | 12 | | |
| Ravenclaw | 15 | | |
| Slytherin | 21 | | |
| Gryffindor | 36 | | |
+------------+--------+ | |
4 rows in set (0.00 sec) |
This file contains hidden or 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> SELECT lastname,firstname,role,name FROM wizard LEFT JOIN player ON wizard.id=player.wizard_id LEFT JOIN team ON team.id=player.team_id ORDER BY name ASC,role,lastname,firstname; | |
+-----------------+-------------+--------+------------+ | |
| lastname | firstname | role | name | | |
+-----------------+-------------+--------+------------+ | |
| | Crabbe | NULL | NULL | | |
| Boot | Terry | NULL | NULL | | |
| Lupin | Remus | NULL | NULL | | |
| Patil | Padma | NULL | NULL | | |
| Patil | Parvati | NULL | NULL | | |
| Robins | Demelza | NULL | NULL | |
This file contains hidden or 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 express = require('express'); | |
const app = express(); | |
const port = 8000; | |
const connection = require('./config'); | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ |
This file contains hidden or 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 express = require('express'); | |
const app = express(); | |
const port = 8000; | |
const connection = require('./config'); | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ |
This file contains hidden or 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 express = require('express'); | |
const app = express(); | |
const port = 8000; | |
const connection = require('./config'); | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ |
This file contains hidden or 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 express = require('express'); | |
const app = express(); | |
const port = 8000; | |
const connection = require('./config'); | |
// app.get('/', (request, response) => { | |
// response.send('Bienvenue sur Express'); | |
// }); | |
// app.get('/api/movies', (request, response) => { | |
// response.send("Récupération de tous les films"); |
This file contains hidden or 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 express = require('express'); | |
const app = express(); | |
const port = 3000; | |
app.get('/', (request, response) => { | |
response.send('Bienvenue sur Express'); | |
}); | |
app.get('/api/movies', (request, response) => { | |
response.send("Récupération de tous les films"); | |
}); |
This file contains hidden or 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 http = require('http'); | |
const port = 3000; | |
const requestHandler = (request, response) => { | |
/* console.log(request.url); | |
response.end('Bienvenue sur votre serveur !!'); */ | |
if (request.url === "/") { | |
response.end('Bienvenue sur votre serveur !!'); | |
} | |
if (request.url === "/contact") { |
NewerOlder