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> SELECT w.lastname, w.firstname, p.role, t.name AS team FROM wizard w JOIN player p ON w.id = p.wizard_id JOIN team t ON t.id = p.team_id ORDER BY team, p.role, w.lastname, w.firstname; | |
+-----------------+-------------+--------+------------+ | |
| lastname | firstname | role | team | | |
+-----------------+-------------+--------+------------+ | |
| Black | Sirius | beater | Gryffindor | | |
| Brown | Lavender | beater | Gryffindor | | |
| Finnigan | Seamus | beater | Gryffindor | | |
| Hagrid | Rubeus | beater | Gryffindor | | |
| Longbottom | Alice | beater | Gryffindor | | |
| McGonagall | Minerva | beater | Gryffindor | |
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 express = require('express'); | |
const connection = require('./configmovie'); | |
const app = express(); | |
const port = 3000; | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ | |
extended: true |
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 express = require('express'); | |
const connection = require('./configmovie'); | |
const app = express(); | |
const port = 3000; | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ | |
extended: true |
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 express = require('express'); | |
const connection = require('./configmovie'); | |
const app = express(); | |
const port = 3000; | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ | |
extended: true |
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 express = require('express'); | |
const connection = require('./configmovie'); | |
const app = express(); | |
const port = 3000; | |
app.use(express.static(__dirname + './expquest')) | |
console.log(connection) | |
// listen to "/api/employees" |
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 http = require("http"); | |
const url = require('url'); | |
const port = 8000; | |
const requestHandler = (request, response) => { | |
console.log(request.url); | |
if (request.url === '/') { | |
response.end('Hello, you can copy and past this and change it! : /?name=Armando&city=LeMans'); | |
} else if (request.url !== '/') { |
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
INSERT INTO school (name, country, capacity) VALUES ('Beauxbatons Academy of Magic', 'France', 550), | |
('Castelobruxo', 'Brazil', 380), ('Durmstang institute', 'Norway', 570), | |
('Hogwarts School of Witchcraft and Wizardry', 'United-Kingdom', 450), | |
('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300), | |
('Koldovstoretz', 'Russia', 125), | |
('Mahoutokoro School of Magic', 'Japan', 800), | |
('Uagadou School of Magic', 'Uganda', 350); | |
mysql> UPDATE school SET country='Sweden' WHERE id=3; |
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> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-12-31'; | |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| id | firstname | lastname | birthday | birth_place | biography | is_muggle | | |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| 1 | harry | potter | 1980-07-31 | london | | 0 | | |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 | | |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 | | |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 | | |
| 6 | fred | weasley | 1978-04-01 | | | 0 | | |
| 7 | george | weasley | 1978-04-01 | | |
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 express = require('express'); | |
const app = express(); | |
const port = 3000; | |
app.use(express.static(__dirname + './expquest')) | |
app.get('/api/employee/', (err,req,next, res) => { | |
res.sendStatus(304).send('erreur 304'); | |
}); | |
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
### get status | |
GET https://http-practice.herokuapp.com/status | |
### GET application status in JSON format | |
GET https://http-practice.herokuapp.com/status | |
Accept: application/json | |
### GET wilders sans filtrage | |
GET https://http-practice.herokuapp.com/wilders |