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
html | |
head | |
title= title | |
body | |
h1= message |
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; | |
const connection = require('./conf'); | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies |
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
# Supprimer le film ayant l'ID 5 | |
DELETE FROM `movie` WHERE id='5'; | |
# Supprimer les films dont l'ID est supérieur à 10 | |
DELETE FROM `movie` WHERE id > '10'; |
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; | |
const connection = require('./conf'); | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies |
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; | |
const connection = require('./conf'); | |
const bodyParser = require('body-parser'); | |
// Support JSON-encoded bodies | |
app.use(bodyParser.json()); | |
// Support URL-encoded bodies | |
app.use(bodyParser.urlencoded({ |
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 dump 10.13 Distrib 5.7.24, for Linux (x86_64) | |
-- | |
-- Host: localhost Database: monica_t_wcs_paris | |
-- ------------------------------------------------------ | |
-- Server version 5.7.24-0ubuntu0.18.04.1 | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; |
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 a film without to call the columns | |
INSERT INTO movie | |
VALUES ( | |
null, | |
'Harry Potter and the Philosopher Stone', | |
'http://fr.web.img6.acsta.net/r_1280_720/pictures/14/04/30/11/55/592219.jpg', | |
'Orphelin, Harry Potter a été recueilli à contrecœur par son oncle Vernon et sa tante Pétunia, aussi cruels que mesquins, qui n\'hésitent pas à le faire dormir dans le placard sous l\'escalier.' ); | |
// insert a film, with columns | |
INSERT INTO movie |
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; | |
const connection = require('./conf'); | |
// écoute de l'url "/api/movies" | |
app.get('/api/movies', (req, res) => { | |
// connection à la base de données, et sélection toutes les données des films | |
connection.query('SELECT * from movie', (err, results) => { |
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.get('/', (req, res) => { | |
res.send('Bienvenue sur Express'); | |
}); | |
/* Une route répondant à l'url /api/movies qui envoie comme informations | |
une chaîne de caractères contenant "Récupération de tous les films" */ |
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 server = http.createServer((request, response) => { | |
let path = request.url; | |
console.log(path); | |
response.writeHead(200, { | |
'Content-type':'text/html; charset=utf-8'}) |
NewerOlder