Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 19th, 2018 72 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. // Récupérer l'ensemble des films de la table:
  2. const connection = require('./conf');
  3.  
  4. app.get('/api/movie', (req, res) => {
  5.   connection.query('SELECT * from movie', (err, results) => {
  6.     if(err) {
  7.       res.status(500).send('Erreur lors de la récupération des films');
  8.     } else {
  9.       res.json(results);
  10.     }
  11.   });
  12. });
  13.  
  14. // Récupérer les noms de l'ensemble des films:
  15. app.get('/api/movie/name', (req, res) => {
  16.   connection.query('SELECT name from movie', (err, results) => {
  17.     if(err) {
  18.       res.status(500).send('Erreur lors de la récupération des films');
  19.     } else {
  20.       res.json(results);
  21.     }
  22.   });
  23. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top