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
| let express = require('express'); | |
| let app = express(); | |
| let myConsoleLog = (req, res, next) => { | |
| console.log('hello middleware'); | |
| next(); | |
| }; | |
| app.use(myConsoleLog); |
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 movies = require("./movies"); | |
| const connection = require("./config"); | |
| const port = 3000; | |
| const app = express(); | |
| // We try to connect to the Database | |
| connection.connect(function (err) { | |
| if (err) { |
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 movies = require("./movies"); | |
| const connection = require("./config"); | |
| const port = 3000; | |
| const app = express(); | |
| // We try to connect to the Database | |
| connection.connect(function (err) { | |
| if (err) { |
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 movies = require("./movies"); | |
| const connection = require("./config"); | |
| const port = 3000; | |
| const app = express(); | |
| // We try to connect to the Database | |
| connection.connect(function (err) { | |
| if (err) { |
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 = 8000; | |
| const url = require('url'); | |
| // const requestHandler = (request, response) => { | |
| // console.log(request.url); | |
| // if (request.url === '/') { | |
| // response.end('Hello Node.js Server!'); | |
| // } else if (request.url === '/about') { | |
| // response.end('This demonstrates routing with Node.js.'); |
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 connection = require("./config"); | |
| const express = require("express"); | |
| const movies = require("./movies"); | |
| const port = 3000; | |
| const app = express(); | |
| connection.connect(function(err) { | |
| if (err) { | |
| console.error('error connecting: ' + err.stack); |
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 helloWorld = () => { | |
| return "Hello World!"; | |
| } | |
| console.log(helloWorld()); | |
| const displayMessage = (message = "No message") => message | |
| console.log(displayMessage("dude!")); | |
| const double = a => a * 2 | |
| console.log(double(3)); |
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
| Last login: Tue Sep 15 12:11:17 on ttys000 | |
| Antoine:~ macbook$ ls | |
| Applications Downloads Music planets | |
| Desktop Library Pictures planets.zip | |
| Documents Movies Public | |
| Antoine:~ macbook$ cd planets | |
| Antoine:planets macbook$ mv earth planetes/reelles/terrestre | |
| mv: rename earth to planetes/reelles/terrestre/earth: No such file or directory | |
| Antoine:planets macbook$ ls | |
| arrakis.jpeg earth.jpeg mercury.jpeg pluto.jpeg venus.jpeg |
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
| Last login: Tue Sep 15 10:06:50 on ttys000 | |
| Antoine:~ macbook$ pwd | |
| /Users/macbook | |
| Antoine:~ macbook$ cd .. | |
| Antoine:Users macbook$ pwd | |
| /Users | |
| Antoine:Users macbook$ cd .. | |
| Antoine:/ macbook$ pwd | |
| / | |
| Antoine:/ macbook$ ls |
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
| debut NbreBonbon (reel argent, reel prix, entier resultat) | |
| Si argent > 0 et prix > 0 alors | |
| tant que argent > prix | |
| resultat <- argent - prix | |
| fin tant que | |
| retourner resultat | |
| Fin NbreBonbon |