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
xofym pwapp |
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 assert = require('assert') | |
// Type your code here | |
const capitalizeFirstLetters =(input)=>{ | |
// return input.length && !input.includes(' ') > 0 ? input[0].toUpperCase() + input.slice(1): ''; | |
// first code version | |
let output = ''; | |
if (input.length >0 && !input.includes(' ') ){ | |
for (let i = 0 ; i < input.length ; i++) { |
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 router = express.Router(); | |
router.get('/', (req, res)=>{ | |
res.send('Hello 🌎, welcome on Aliens 👽 API!') | |
}); | |
let helloMiddleware = (req, res, next) =>{ | |
console.log('hello middleware'); | |
next(); |
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
// Express 2 - 🚀 Lecture depuis la base de données | |
const express = require("express"); | |
const movies = require("./movies"); | |
const connection = require("../config"); | |
const port = 3000; | |
const app = express(); | |
app.use(express.json()) |
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
// Express 2 - 🚀 Lecture depuis la base de données | |
const express = require("express"); | |
const movies = require("./movies"); | |
const connection = require("../config"); | |
const port = 3000; | |
const app = express(); | |
app.use(express.json()) |
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
// Express 2 - 🚀 Lecture depuis la base de données | |
const express = require("express"); | |
const movies = require("./movies"); | |
const connection = require("../config"); | |
const port = 3000; | |
const app = express(); | |
app.use(express.json()) |
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
QUERY 1 | |
mysql> SELECT name, COUNT(*) AS player_number FROM wizard w JOIN player p ON p.wizard_id=w.id JOIN team t ON p.team_id=t.id GROUP BY name ORDER BY player_number DESC; | |
+------------+---------------+ | |
| name | player_number | | |
+------------+---------------+ | |
| Gryffindor | 36 | | |
| Slytherin | 21 | | |
| Ravenclaw | 15 | | |
| Hufflepuff | 12 | |
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
QUERY_1 | |
SELECT name, role, lastname, firstname FROM wizard JOIN player ON player.wizard_id=wizard.id JOIN team ON player.team_id=team.id ORDER BY name ASC, role ASC, lastname ASC, firstname ASC; | |
+------------+--------+-----------------+-------------+ | |
| name | role | lastname | firstname | | |
+------------+--------+-----------------+-------------+ | |
| Gryffindor | beater | Black | Sirius | | |
| Gryffindor | beater | Brown | Lavender | | |
| Gryffindor | beater | Finnigan | Seamus | | |
| Gryffindor | beater | Hagrid | Rubeus | |
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
// Express 2 - 🚀 Lecture depuis la base de données | |
const express = require("express"); | |
const movies = require("./movies"); | |
const connection = require("../config"); | |
const port = 3000; | |
const app = express(); |
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
Node.js - Créer un serveur HTTP | |
// HTTP server type require http | |
const http = require('http'); | |
// port on which the server will run | |
const port = 8000; | |
// url module import | |
const url = require('url'); |
NewerOlder