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; | |
const connection = require("./conf"); | |
// Support JSON-encoded bodies | |
app.use(express.json()); | |
// Support URL-encoded bodies | |
app.use( | |
express.urlencoded({ | |
extended: true, |
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; | |
const connection = require("./conf"); | |
app.get("/api/employees", (req, res) => { | |
connection.query("SELECT * from employee", (err, results) => { | |
if (err) { | |
res.status(500).send(err); | |
} else { |
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 { response } = require("express"); | |
const app = express(); | |
const port = 3000; | |
app.get("/", (request, response) => { | |
response.send("Bienvenue sur Express"); | |
}); | |
app.get("/api/movies", (req, res) => { |
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 url = require("url"); | |
const port = 8000; | |
const requestHandler = (request, response) => { | |
if (request.url === "/") { | |
response.end("Please provide name and city parameters si l'url"); | |
} else { | |
let queryS = url.parse(request.url, true).query; |
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> INSERT INTO school (name, country, capacity) | |
-> VALUES ('Beauxbatons Academy of Magic', 'France', 550), | |
-> ('Castelobruxo', 'Brazil', 380), | |
-> ('Durmstrang 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); | |
Query OK, 8 rows affected (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 * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01'; | |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| id | firstname | lastname | birthday | birth_place | biography | is_muggle | | |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+ | |
| 14 | harry | potter | 1980-07-31 | london | | 0 | | |
| 15 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 | | |
| 17 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 | | |
| 18 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 | | |
| 19 | fred | weasley | 1978-04-01 | | | 0 | | |
| 20 | george | weasley | 1978-04-01 | | |
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
### GET wilders with the API | |
GET https://http-practice.herokuapp.com/wilders | |
### GET wilders on JavaScript with the API | |
GET https://http-practice.herokuapp.com/wilders?language=JavaScript | |
### GET wilders on JavaScript with the API & a big number | |
GET https://http-practice.herokuapp.com/wilders?language=JavaScript&page=100000 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="style.css" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<header> |
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
(function () { | |
let dataClinics = [ | |
{ | |
id: 1, | |
clinic: 'The Smiling House', | |
img_clinique:'https://www.lasource.ch/sites/default/files/styles/crop_3_2/public/images/content_types/page/specialites.jpg?itok=1eShRFbt', | |
city: 'Bucarest', | |
country: 'Romania', | |
price:[823,256], |
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
npm install -g cowsay | |
let cowsay = require("cowsay"); | |
console.log(cowsay.say({ | |
text : "hello boy", | |
})); | |