Skip to content
Snippets Groups Projects
movieController.js 398 B
Newer Older
  • Learn to ignore specific revisions
  • Bastien's avatar
    Bastien committed
    const db = require('../models/db');
    
    exports.getMovieInformations = (req,res,next) => {
        let filmId = req.params.id;
    
        db.query('SELECT * FROM Film WHERE tconst = ?',
        [filmId],function (error,results,fields) {
    
            if (error) {
                res.status(500).json({error});
            } else {
                let infos = results[0];
                res.status(200).json(infos);
            }
        })
    };