Skip to content

Instantly share code, notes, and snippets.

const express = require('express');
const app = express();
const port = 3000;
app.get('/', (request, response) => {
response.send('Bienvenue sur Express');
});
app.get('/api/movies', (request, response) => {
response.send('Récupération de tous les films');
### GEt
GET https://http-practice.herokuapp.com/wilders
Accept: application/json
### GEt
GET https://http-practice.herokuapp.com/wilders?language=PHP
Accept: application/json
###Post
const http = require('http')
const url = require('url');
const port = 8000
const urlNoQuery = '/?name=&city='
const parsedUrlNoQuery = url.parse(urlNoQuery, true);
const requestHandler = (request, response) => {
const parsedUrl = url.parse(request.url, true);
console.log(request.url)
if (request.url === urlNoQuery){
mysql> DELETE FROM school WHERE name LIKE '%Magic%';
Query OK, 3 rows affected (0.01 sec)
mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01;'
-> ;
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| id | firstname | lastname | birthday | birth_place | biography | is_muggle |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| 1 | harry | potter | 1980-07-31 | london | | 0 |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
| 6 | fred | weasley | 1978-04-01 | | | 0 |
mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01;'
-> ;
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| id | firstname | lastname | birthday | birth_place | biography | is_muggle |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| 1 | harry | potter | 1980-07-31 | london | | 0 |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
| 6 | fred | weasley | 1978-04-01 | | | 0 |
mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01;'
-> ;
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| id | firstname | lastname | birthday | birth_place | biography | is_muggle |
+----+-----------+----------+------------+-------------+---------------------------------------+-----------+
| 1 | harry | potter | 1980-07-31 | london | | 0 |
| 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
| 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
| 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
| 6 | fred | weasley | 1978-04-01 | | | 0 |
import React from 'react'
import { Component } from 'react';
class Logger extends Component {
constructor(props){
super(props)
this.state={
date:new Date()
}
}
import React from 'react';
import Contact from './components/contact'
const contact1 ={
names : 'Tonya Campbell',
avatar: 'https://randomuser.me/api/portraits/women/18.jpg',
online: true,
textOn:'online',
textOff:'offline'
import React,{Component} from 'react';
import Simpson from './components/Simpson';
const bart = {
firstName:"Bart" ,
lastName:"SIMPSON",
image:"https://avatarfiles.alphacoders.com/144/thumb-144535.jpg ",
image2:"https://www.drupal.org/files/issues/default-avatar.png",