GET Method

Following this method and put this in main file api.js

app.get('/movies', function(req, res){
    var sql = 'SELECT * FROM t_movie';
    con.query(sql, function(err, rows){
       if(err){
           res.json({"Error": true, "Message":"Error Execute Sql"});
       }else{
           res.json({"Error": false, "Message": "Success", "Movies" : rows});
       }
    });
})

And run in Postman with type localhost:3000/movies

results matching ""

    No results matching ""