Skip to content

Instantly share code, notes, and snippets.

angelique-w

Block or report user

Report or block angelique-w

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Counter Redux</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Redux CDN -->
@angelique-w
angelique-w / index.js
Created Dec 3, 2019
quête express 5
View index.js
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./conf');
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
@angelique-w
angelique-w / index.js
Created Dec 3, 2019
quête express 5
View index.js
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./conf');
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
@angelique-w
angelique-w / index.js
Created Dec 3, 2019
quête express 4
View index.js
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./conf');
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
@angelique-w
angelique-w / index.js
Created Dec 3, 2019
quête express 3
View index.js
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./conf');
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
View index.js
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./conf');
app.get("/api/movies", (req, res) => {
connection.query('SELECT * FROM movie', (err, results) => {
if (err) {
res.status(500).send('Erreur lors de la récupération des films');
View quest-express-1.js
const express = require('express');
const app = express();
const port = 3000;
app.get('/api/movies', (req, res) => {
res.send('Récupération de tous les films')
})
app.get('/api/movies/:id', (req, res) => {
const idMovie = req.params.id;
View request.http
###
GET https://http-practice.herokuapp.com/wilders
Accept: application/json
###
GET https://http-practice.herokuapp.com/wilders?page=2&language=PHP
###
POST https://http-practice.herokuapp.com/wilders
Content-Type: application/x-www-form-urlencoded
View server.js
const http = require('http');
const url = require('url');
const port = 8000;
const requestHandler = (request, response) => {
console.log(request.url);
const parsedUrl = url.parse(request.url, true);
const parsedUrlQuery = parsedUrl.query;
console.log(parsedUrlQuery);
if (parsedUrlQuery.name && parsedUrlQuery.city) {
View quest-3-mysql.sql
mysql> INSERT INTO school (name, country, capacity) VALUES ('Beauxbatons Academy of Magic', 'France', 550), ('Castelobruxo', 'Brazil', 380), ('Durmstrang Institute', 'Norway', 570), ('Koldovstoretz', 'Russia', 125), ('Mahoutokoro School of Magic', 'Japan', 800), ('Uagadou School of Magic', 'Uganda', 350);
mysql> UPDATE school SET country='Sweden' WHERE id=3;
mysql> UPDATE school SET capacity=700 WHERE id=5;
mysql> DELETE FROM school WHERE name LIKE '%Magic%';
mysql> SELECT * FROM school;
+----+----------------------+----------+---------+
You can’t perform that action at this time.