diff --git a/Enrique/index.js b/Enrique/index.js index 74f606e..7ff7fdb 100644 --- a/Enrique/index.js +++ b/Enrique/index.js @@ -164,7 +164,7 @@ module.exports = (app, dbMovies) => { if (cambio.original_title === objeto.original_title) { // Utilizo inser con upsert = true para que el objeto ya existente se actualice, es decir se haga el PUT dbMovies.update({ original_title: title}, cambio, { upsert: true }); - res.sendStatus(201, "Updated"); + res.sendStatus(201, "Created"); } else { res.sendStatus(400, "Bad Request"); } diff --git a/Enrique/tests/CollectionAPIEGO.json b/Enrique/tests/CollectionAPIEGO.json new file mode 100644 index 0000000..2ca3918 --- /dev/null +++ b/Enrique/tests/CollectionAPIEGO.json @@ -0,0 +1,454 @@ +{ + "info": { + "_postman_id": "1d08c22d-10fd-40c6-a184-93253d76fc48", + "name": "API Requests", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "33038669" + }, + "item": [ + { + "name": "INIT DATA /api/v1/movies-dataset/loadInitialData", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset/loadInitialData", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset", + "loadInitialData" + ] + } + }, + "response": [] + }, + { + "name": "GET /api/v1/movies-dataset", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset" + ] + } + }, + "response": [] + }, + { + "name": "GET NOT FOUND /api/v1/datos-peliculas", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SERVER}}/api/v1/datos-peliculas", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "datos-peliculas" + ] + } + }, + "response": [] + }, + { + "name": "POST api/v1/movies-dataset", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"index\": 10,\r\n \"budget\": 270000000,\r\n \"genres\": \"Adventure Fantasy Action Science Fiction\",\r\n \"id\": 1452,\r\n \"keywords\": \"saving the world dc comics invulnerability sequel superhero\",\r\n \"original_language\": \"en\",\r\n \"original_title\": \"Superman Returns\",\r\n \"overview\": \"Superman returns to discover his 5-year absence has allowed Lex Luthor to walk free, and that those he was closest too felt abandoned and have moved on. Luthor plots his ultimate revenge that could see millions killed and change the face of the planet forever, as well as ridding himself of the Man of Steel.\",\r\n \"popularity\": 57.925623,\r\n \"production_companies\": [\r\n {\r\n \"name\": \"DC Comics\",\r\n \"id\": 429\r\n },\r\n {\r\n \"name\": \"Legendary Pictures\",\r\n \"id\": 923\r\n },\r\n {\r\n \"name\": \"Warner Bros.\",\r\n \"id\": 6194\r\n },\r\n {\r\n \"name\": \"Bad Hat Harry Productions\",\r\n \"id\": 9168\r\n }\r\n ],\r\n \"production_countries\": [\r\n {\r\n \"iso_3166_1\": \"US\",\r\n \"name\": \"United States of America\"\r\n }\r\n ],\r\n \"release_date\": \"2006-06-28\",\r\n \"revenue\": 391081192,\r\n \"runtime\": 154,\r\n \"status\": \"Released\",\r\n \"tagline\": \"\",\r\n \"title\": \"Superman Returns\",\r\n \"vote_average\": 5.4,\r\n \"vote_count\": 1400,\r\n \"director\": \"Bryan Singer\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset" + ] + } + }, + "response": [] + }, + { + "name": "BAD REQUEST /api/v1/movies-dataset", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"index\": 10,\r\n \"budget\": 270000000,\r\n \"gender\": \"Adventure Fantasy Action Science Fiction\",\r\n \"ido\": 1452,\r\n \"keywords\": \"saving the world dc comics invulnerability sequel superhero\",\r\n \"original_language\": \"en\",\r\n \"original_title\": \"Superman Returns\",\r\n \"overview\": \"Superman returns to discover his 5-year absence has allowed Lex Luthor to walk free, and that those he was closest too felt abandoned and have moved on. Luthor plots his ultimate revenge that could see millions killed and change the face of the planet forever, as well as ridding himself of the Man of Steel.\",\r\n \"popularity\": 57.925623,\r\n \"production_companies\": [\r\n {\r\n \"name\": \"DC Comics\",\r\n \"id\": 429\r\n },\r\n {\r\n \"name\": \"Legendary Pictures\",\r\n \"id\": 923\r\n },\r\n {\r\n \"name\": \"Warner Bros.\",\r\n \"id\": 6194\r\n },\r\n {\r\n \"name\": \"Bad Hat Harry Productions\",\r\n \"id\": 9168\r\n }\r\n ],\r\n \"production_countries\": [\r\n {\r\n \"iso_3166_1\": \"US\",\r\n \"name\": \"United States of America\"\r\n }\r\n ],\r\n \"release_date\": \"2006-06-28\",\r\n \"revenue\": 391081192,\r\n \"runtime\": 154,\r\n \"status\": \"Released\",\r\n \"tagline\": \"\",\r\n \"title\": \"Superman Returns\",\r\n \"vote_average\": 5.4,\r\n \"vote_count\": 1400,\r\n \"director\": \"Bryan Singer\"\r\n }", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset" + ] + } + }, + "response": [] + }, + { + "name": "PUT NOT ALLOWED /api/v1/movies-dataset", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 405\", function () {\r", + " pm.response.to.have.status(405);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"index\": 0,\r\n \"budget\": 237000000,\r\n \"genres\": \"Action Adventure Fantasy Science Fiction\",\r\n \"id\": 19995,\r\n \"keywords\": \"culture clash future space war space colony society\",\r\n \"original_language\": \"en\",\r\n \"original_title\": \"Avatar\",\r\n \"overview\": \"In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization.\",\r\n \"popularity\": 150.437577,\r\n \"production_companies\": [\r\n {\r\n \"name\": \"Ingenious Film Partners\",\r\n \"id\": 289\r\n },\r\n {\r\n \"name\": \"Twentieth Century Fox Film Corporation\",\r\n \"id\": 306\r\n },\r\n {\r\n \"name\": \"Dune Entertainment\",\r\n \"id\": 444\r\n },\r\n {\r\n \"name\": \"Lightstorm Entertainment\",\r\n \"id\": 574\r\n }\r\n ],\r\n \"production_countries\": [\r\n {\r\n \"iso_3166_1\": \"US\",\r\n \"name\": \"United States of America\"\r\n },\r\n {\r\n \"iso_3166_1\": \"GB\",\r\n \"name\": \"United Kingdom\"\r\n },\r\n {\r\n \"iso_3166_1\": \"ES\",\r\n \"name\": \"España\"\r\n }\r\n ],\r\n \"release_date\": \"2009-12-10\",\r\n \"revenue\": 2787965087,\r\n \"runtime\": 162,\r\n \"status\": \"Released\",\r\n \"tagline\": \"Enter the World of Pandora.\",\r\n \"title\": \"Avatar\",\r\n \"vote_average\": 7.2,\r\n \"vote_count\": 11800,\r\n \"director\": \"James Cameron\"\r\n }", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset" + ] + } + }, + "response": [] + }, + { + "name": "GET /api/v1/movies-dataset/Avatar", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset/Avatar", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset", + "Avatar" + ] + } + }, + "response": [] + }, + { + "name": "POST NOT ALLOWED /api/v1/movies-dataset/Avatar", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 405\", function () {\r", + " pm.response.to.have.status(405);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"index\": 10,\r\n \"budget\": 270000000,\r\n \"genres\": \"Adventure Fantasy Action Science Fiction\",\r\n \"id\": 1452,\r\n \"keywords\": \"saving the world dc comics invulnerability sequel superhero\",\r\n \"original_language\": \"en\",\r\n \"original_title\": \"Superman Returns\",\r\n \"overview\": \"Superman returns to discover his 5-year absence has allowed Lex Luthor to walk free, and that those he was closest too felt abandoned and have moved on. Luthor plots his ultimate revenge that could see millions killed and change the face of the planet forever, as well as ridding himself of the Man of Steel.\",\r\n \"popularity\": 57.925623,\r\n \"production_companies\": [\r\n {\r\n \"name\": \"DC Comics\",\r\n \"id\": 429\r\n },\r\n {\r\n \"name\": \"Legendary Pictures\",\r\n \"id\": 923\r\n },\r\n {\r\n \"name\": \"Warner Bros.\",\r\n \"id\": 6194\r\n },\r\n {\r\n \"name\": \"Bad Hat Harry Productions\",\r\n \"id\": 9168\r\n }\r\n ],\r\n \"production_countries\": [\r\n {\r\n \"iso_3166_1\": \"US\",\r\n \"name\": \"United States of America\"\r\n }\r\n ],\r\n \"release_date\": \"2006-06-28\",\r\n \"revenue\": 391081192,\r\n \"runtime\": 154,\r\n \"status\": \"Released\",\r\n \"tagline\": \"\",\r\n \"title\": \"Superman Returns\",\r\n \"vote_average\": 5.4,\r\n \"vote_count\": 1400,\r\n \"director\": \"Bryan Singer\"\r\n }", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset/Avatar", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset", + "Avatar" + ] + } + }, + "response": [] + }, + { + "name": "PUT /api/v1/movies-dataset/Avatar", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"index\": 0,\r\n \"budget\": 237000000,\r\n \"genres\": \"Action Adventure Fantasy Science Fiction\",\r\n \"id\": 19995,\r\n \"keywords\": \"culture clash future space war space colony society\",\r\n \"original_language\": \"en\",\r\n \"original_title\": \"Avatar\",\r\n \"overview\": \"In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization.\",\r\n \"popularity\": 150.437577,\r\n \"production_companies\": [\r\n {\r\n \"name\": \"Ingenieros Film Partners\",\r\n \"id\": 100\r\n },\r\n {\r\n \"name\": \"Twentieth Century Fox Film Corporation\",\r\n \"id\": 306\r\n },\r\n {\r\n \"name\": \"Dune Entertainment\",\r\n \"id\": 444\r\n },\r\n {\r\n \"name\": \"Lightstorm Entertainment\",\r\n \"id\": 574\r\n }\r\n ],\r\n \"production_countries\": [\r\n {\r\n \"iso_3166_1\": \"US\",\r\n \"name\": \"United States of America\"\r\n },\r\n {\r\n \"iso_3166_1\": \"GB\",\r\n \"name\": \"United Kingdom\"\r\n },\r\n {\r\n \"iso_3166_1\": \"ES\",\r\n \"name\": \"España\"\r\n }\r\n ],\r\n \"release_date\": \"2009-12-10\",\r\n \"revenue\": 2787965087,\r\n \"runtime\": 162,\r\n \"status\": \"Released\",\r\n \"tagline\": \"Enter the World of Pandora.\",\r\n \"title\": \"Avatar\",\r\n \"vote_average\": 7.2,\r\n \"vote_count\": 11800,\r\n \"director\": \"James Cameron\"\r\n }", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset/Avatar", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset", + "Avatar" + ] + } + }, + "response": [] + }, + { + "name": "BAD REQUES PUT /api/v1/movies-dataset", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"index\": 0,\r\n \"budget\": 237000000,\r\n \"genres\": \"Action Adventure Fantasy Science Fiction\",\r\n \"id\": 19995,\r\n \"keywords\": \"culture clash future space war space colony society\",\r\n \"original_language\": \"en\",\r\n \"original_title\": \"Avatar 2\",\r\n \"overview\": \"In the 22nd century, a paraplegic Marine is dispatched to the moon Pandora on a unique mission, but becomes torn between following orders and protecting an alien civilization.\",\r\n \"popularity\": 150.437577,\r\n \"production_companies\": [\r\n {\r\n \"name\": \"Ingenieros Film Partners\",\r\n \"id\": 100\r\n },\r\n {\r\n \"name\": \"Twentieth Century Fox Film Corporation\",\r\n \"id\": 306\r\n },\r\n {\r\n \"name\": \"Dune Entertainment\",\r\n \"id\": 444\r\n },\r\n {\r\n \"name\": \"Lightstorm Entertainment\",\r\n \"id\": 574\r\n }\r\n ],\r\n \"production_countries\": [\r\n {\r\n \"iso_3166_1\": \"US\",\r\n \"name\": \"United States of America\"\r\n },\r\n {\r\n \"iso_3166_1\": \"GB\",\r\n \"name\": \"United Kingdom\"\r\n },\r\n {\r\n \"iso_3166_1\": \"ES\",\r\n \"name\": \"España\"\r\n }\r\n ],\r\n \"release_date\": \"2009-12-10\",\r\n \"revenue\": 2787965087,\r\n \"runtime\": 162,\r\n \"status\": \"Released\",\r\n \"tagline\": \"Enter the World of Pandora.\",\r\n \"title\": \"Avatar\",\r\n \"vote_average\": 7.2,\r\n \"vote_count\": 11800,\r\n \"director\": \"James Cameron\"\r\n }", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset/Avatar", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset", + "Avatar" + ] + } + }, + "response": [] + }, + { + "name": "DELETE /api/v1/movies-dataset/Avatar", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset/Avatar", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset", + "Avatar" + ] + } + }, + "response": [] + }, + { + "name": "DELETE api/v1/movies-dataset", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{SERVER}}/api/v1/movies-dataset", + "host": [ + "{{SERVER}}" + ], + "path": [ + "api", + "v1", + "movies-dataset" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/Enrique/tests/enviroments/GCloudEnv.json b/Enrique/tests/enviroments/GCloudEnv.json new file mode 100644 index 0000000..5f5a469 --- /dev/null +++ b/Enrique/tests/enviroments/GCloudEnv.json @@ -0,0 +1,15 @@ +{ + "id": "3efd6382-3e2a-4b43-a3d9-ccc8f02f7477", + "name": "GCloud", + "values": [ + { + "key": "SERVER", + "value": "https://sos2324-14.ew.r.appspot.com", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2024-03-07T21:13:41.086Z", + "_postman_exported_using": "Postman/10.23.8" +} \ No newline at end of file diff --git a/Enrique/tests/enviroments/localhostEnv.json b/Enrique/tests/enviroments/localhostEnv.json new file mode 100644 index 0000000..030cc23 --- /dev/null +++ b/Enrique/tests/enviroments/localhostEnv.json @@ -0,0 +1,15 @@ +{ + "id": "7fd09ba4-8f4a-4507-8040-f6ae1601d3e5", + "name": "localhost", + "values": [ + { + "key": "SERVER", + "value": "http://localhost:10002", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2024-03-07T21:13:35.800Z", + "_postman_exported_using": "Postman/10.23.8" +} \ No newline at end of file diff --git a/Victor/api-VEG.js b/Victor/api-VEG.js index fcdaa46..d2c4237 100644 --- a/Victor/api-VEG.js +++ b/Victor/api-VEG.js @@ -1,10 +1,10 @@ const data_VEG = require('./index-VEG'); const API_BASE = "/api/v1"; -const dataStore = require('nedb'); -const db = new dataStore({ filename: 'data.db', autoload: true }); +//const dataStore = require('nedb'); +//const db = new dataStore({ filename: 'data.db', autoload: true }); -function api_VEG(app) { +function api_VEG(app, db) { //let dataset = new Array(); diff --git a/data.db b/data.db index a9d67a8..e69de29 100644 --- a/data.db +++ b/data.db @@ -1,92 +0,0 @@ -{"id":1,"country":"Albania","title":"Dhurata Dora x Elvana Gjata - GAJDE (Official Video)","published_at":"2022-06-30T22:00:11Z","channel_title":"Dhurata Dora","category_id":10,"trending_date":"22.11.07","view_count":8886648,"comment_count":4414,"_id":"2fwaYsl5Mh7I0ztd"} -{"id":4,"country":"Albania","title":"Tayna x Azet - Tequila","published_at":"2022-06-30T18:00:26Z","channel_title":"Friends Entertainment","category_id":10,"trending_date":"22.11.07","view_count":6397676,"comment_count":6063,"_id":"7tHjtepHptQL1kcv"} -{"id":5,"country":"Albania","title":"GJIKO x FIFI - DJEGI KREJT","published_at":"2022-07-07T17:45:11Z","channel_title":"REDBOX Entertainment","category_id":10,"trending_date":"22.11.07","view_count":1695364,"comment_count":1961,"_id":"TAk8HRoLoyFuFT12"} -{"id":0,"country":"Albania","title":"DON XHONI - KATILE","published_at":"2022-07-07T22:00:12Z","channel_title":"DON XHONI","category_id":24,"trending_date":"22.11.07","view_count":5130167,"comment_count":3641,"_id":"bCJTa11XzWQUeoWF"} -{"id":2,"country":"Albania","title":"KIDA x BUTRINT IMERI - AM/PM","published_at":"2022-07-02T22:00:11Z","channel_title":"KIDA","category_id":10,"trending_date":"22.11.07","view_count":7230818,"comment_count":7518,"_id":"cwfzrD80ujX7Ek8Z"} -{"id":7,"country":"Albania","title":"Capital T - Dukat (prod. Panda Music)","published_at":"2022-06-29T16:00:03Z","channel_title":"Capital T","category_id":10,"trending_date":"22.11.07","view_count":7110466,"comment_count":1230,"_id":"dDiMfTV57ytBoVM4"} -{"id":6,"country":"Albania","title":"Ardian Bujupi x Ledri Vula - GELATO (prod. by Bled)","published_at":"2022-06-30T22:00:11Z","channel_title":"OfficialArdianBujupi","category_id":10,"trending_date":"22.11.07","view_count":3316092,"comment_count":1391,"_id":"fNAf3f9z7gjA2uDd"} -{"id":9,"country":"España","title":"España campeona del mundo","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"gxEVLJIex4B7Jagh"} -{"id":3,"country":"Albania","title":"Dafina Zeqiri - Malli","published_at":"2022-07-07T22:00:12Z","channel_title":"Dafina Zeqiri","category_id":10,"trending_date":"22.11.07","view_count":1406078,"comment_count":827,"_id":"iYP8teBsUMBNAPle"} -{"id":8,"country":"Albania","title":"MatoLale x Jongmen KOKAINA","published_at":"2022-07-05T16:30:27Z","channel_title":"MATOLALE","category_id":10,"trending_date":"22.11.07","view_count":1157204,"comment_count":929,"_id":"oJHdXypjP4FJXBRu"} -{"id":10,"country":"España","title":"España campeona del mundo 2","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"hXMJ5KCGy4Q83cS5"} -{"id":10,"country":"España","title":"España campeona del mundo (put)","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"hXMJ5KCGy4Q83cS5"} -{"$$deleted":true,"_id":"hXMJ5KCGy4Q83cS5"} -{"$$deleted":true,"_id":"2fwaYsl5Mh7I0ztd"} -{"$$deleted":true,"_id":"7tHjtepHptQL1kcv"} -{"$$deleted":true,"_id":"TAk8HRoLoyFuFT12"} -{"$$deleted":true,"_id":"bCJTa11XzWQUeoWF"} -{"$$deleted":true,"_id":"cwfzrD80ujX7Ek8Z"} -{"$$deleted":true,"_id":"dDiMfTV57ytBoVM4"} -{"$$deleted":true,"_id":"fNAf3f9z7gjA2uDd"} -{"$$deleted":true,"_id":"gxEVLJIex4B7Jagh"} -{"$$deleted":true,"_id":"iYP8teBsUMBNAPle"} -{"$$deleted":true,"_id":"oJHdXypjP4FJXBRu"} -{"id":0,"country":"Albania","title":"DON XHONI - KATILE","published_at":"2022-07-07T22:00:12Z","channel_title":"DON XHONI","category_id":24,"trending_date":"22.11.07","view_count":5130167,"comment_count":3641,"_id":"KYQIMXH9AM6tmYQX"} -{"id":1,"country":"Albania","title":"Dhurata Dora x Elvana Gjata - GAJDE (Official Video)","published_at":"2022-06-30T22:00:11Z","channel_title":"Dhurata Dora","category_id":10,"trending_date":"22.11.07","view_count":8886648,"comment_count":4414,"_id":"CnmPjh5rqnYn6Tr9"} -{"id":2,"country":"Albania","title":"KIDA x BUTRINT IMERI - AM/PM","published_at":"2022-07-02T22:00:11Z","channel_title":"KIDA","category_id":10,"trending_date":"22.11.07","view_count":7230818,"comment_count":7518,"_id":"YoSeHbOzVQxOonGh"} -{"id":3,"country":"Albania","title":"Dafina Zeqiri - Malli","published_at":"2022-07-07T22:00:12Z","channel_title":"Dafina Zeqiri","category_id":10,"trending_date":"22.11.07","view_count":1406078,"comment_count":827,"_id":"cBvGTZmZsPn5e3sS"} -{"id":4,"country":"Albania","title":"Tayna x Azet - Tequila","published_at":"2022-06-30T18:00:26Z","channel_title":"Friends Entertainment","category_id":10,"trending_date":"22.11.07","view_count":6397676,"comment_count":6063,"_id":"G9dK7sDdVBiBeePo"} -{"id":5,"country":"Albania","title":"GJIKO x FIFI - DJEGI KREJT","published_at":"2022-07-07T17:45:11Z","channel_title":"REDBOX Entertainment","category_id":10,"trending_date":"22.11.07","view_count":1695364,"comment_count":1961,"_id":"4LLIZHO5Plui1j38"} -{"id":6,"country":"Albania","title":"Ardian Bujupi x Ledri Vula - GELATO (prod. by Bled)","published_at":"2022-06-30T22:00:11Z","channel_title":"OfficialArdianBujupi","category_id":10,"trending_date":"22.11.07","view_count":3316092,"comment_count":1391,"_id":"psqFXIoZ8R0acOxm"} -{"id":7,"country":"Albania","title":"Capital T - Dukat (prod. Panda Music)","published_at":"2022-06-29T16:00:03Z","channel_title":"Capital T","category_id":10,"trending_date":"22.11.07","view_count":7110466,"comment_count":1230,"_id":"h92eFMMGU1XpX5dj"} -{"id":8,"country":"Albania","title":"MatoLale x Jongmen KOKAINA","published_at":"2022-07-05T16:30:27Z","channel_title":"MATOLALE","category_id":10,"trending_date":"22.11.07","view_count":1157204,"comment_count":929,"_id":"wUGEcXC6VqVMfMPz"} -{"id":9,"country":"España","title":"España campeona del mundo","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"NoUvfwmloktirsv0"} -{"id":10,"country":"España","title":"España campeona del mundo 2","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"Kr2Zme0PapHmfNs9"} -{"id":10,"country":"España","title":"España campeona del mundo (put)","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"Kr2Zme0PapHmfNs9"} -{"$$deleted":true,"_id":"Kr2Zme0PapHmfNs9"} -{"$$deleted":true,"_id":"4LLIZHO5Plui1j38"} -{"$$deleted":true,"_id":"CnmPjh5rqnYn6Tr9"} -{"$$deleted":true,"_id":"G9dK7sDdVBiBeePo"} -{"$$deleted":true,"_id":"KYQIMXH9AM6tmYQX"} -{"$$deleted":true,"_id":"NoUvfwmloktirsv0"} -{"$$deleted":true,"_id":"YoSeHbOzVQxOonGh"} -{"$$deleted":true,"_id":"cBvGTZmZsPn5e3sS"} -{"$$deleted":true,"_id":"h92eFMMGU1XpX5dj"} -{"$$deleted":true,"_id":"psqFXIoZ8R0acOxm"} -{"$$deleted":true,"_id":"wUGEcXC6VqVMfMPz"} -{"id":0,"country":"Albania","title":"DON XHONI - KATILE","published_at":"2022-07-07T22:00:12Z","channel_title":"DON XHONI","category_id":24,"trending_date":"22.11.07","view_count":5130167,"comment_count":3641,"_id":"ff0EmvdUzjoDp23J"} -{"id":1,"country":"Albania","title":"Dhurata Dora x Elvana Gjata - GAJDE (Official Video)","published_at":"2022-06-30T22:00:11Z","channel_title":"Dhurata Dora","category_id":10,"trending_date":"22.11.07","view_count":8886648,"comment_count":4414,"_id":"pleRwef3ac7raLJ8"} -{"id":2,"country":"Albania","title":"KIDA x BUTRINT IMERI - AM/PM","published_at":"2022-07-02T22:00:11Z","channel_title":"KIDA","category_id":10,"trending_date":"22.11.07","view_count":7230818,"comment_count":7518,"_id":"zPIJLa6sdtHhgWMR"} -{"id":3,"country":"Albania","title":"Dafina Zeqiri - Malli","published_at":"2022-07-07T22:00:12Z","channel_title":"Dafina Zeqiri","category_id":10,"trending_date":"22.11.07","view_count":1406078,"comment_count":827,"_id":"2GDEohtXirip0mMQ"} -{"id":4,"country":"Albania","title":"Tayna x Azet - Tequila","published_at":"2022-06-30T18:00:26Z","channel_title":"Friends Entertainment","category_id":10,"trending_date":"22.11.07","view_count":6397676,"comment_count":6063,"_id":"5TNqckbfNHmjjjgo"} -{"id":5,"country":"Albania","title":"GJIKO x FIFI - DJEGI KREJT","published_at":"2022-07-07T17:45:11Z","channel_title":"REDBOX Entertainment","category_id":10,"trending_date":"22.11.07","view_count":1695364,"comment_count":1961,"_id":"GnCG8BJf6Mu9XlnH"} -{"id":6,"country":"Albania","title":"Ardian Bujupi x Ledri Vula - GELATO (prod. by Bled)","published_at":"2022-06-30T22:00:11Z","channel_title":"OfficialArdianBujupi","category_id":10,"trending_date":"22.11.07","view_count":3316092,"comment_count":1391,"_id":"9IW8xLhK3VDtZPee"} -{"id":7,"country":"Albania","title":"Capital T - Dukat (prod. Panda Music)","published_at":"2022-06-29T16:00:03Z","channel_title":"Capital T","category_id":10,"trending_date":"22.11.07","view_count":7110466,"comment_count":1230,"_id":"nsKjlM9frQJLRLTZ"} -{"id":8,"country":"Albania","title":"MatoLale x Jongmen KOKAINA","published_at":"2022-07-05T16:30:27Z","channel_title":"MATOLALE","category_id":10,"trending_date":"22.11.07","view_count":1157204,"comment_count":929,"_id":"A8AIbtngaTe1sNgn"} -{"id":9,"country":"España","title":"España campeona del mundo","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"wemISP1NleIPFGEO"} -{"id":10,"country":"España","title":"España campeona del mundo 2","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"5A3mYIuqsOzaUdk3"} -{"id":10,"country":"España","title":"España campeona del mundo (put)","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"5A3mYIuqsOzaUdk3"} -{"$$deleted":true,"_id":"5A3mYIuqsOzaUdk3"} -{"$$deleted":true,"_id":"2GDEohtXirip0mMQ"} -{"$$deleted":true,"_id":"5TNqckbfNHmjjjgo"} -{"$$deleted":true,"_id":"9IW8xLhK3VDtZPee"} -{"$$deleted":true,"_id":"A8AIbtngaTe1sNgn"} -{"$$deleted":true,"_id":"GnCG8BJf6Mu9XlnH"} -{"$$deleted":true,"_id":"ff0EmvdUzjoDp23J"} -{"$$deleted":true,"_id":"nsKjlM9frQJLRLTZ"} -{"$$deleted":true,"_id":"pleRwef3ac7raLJ8"} -{"$$deleted":true,"_id":"wemISP1NleIPFGEO"} -{"$$deleted":true,"_id":"zPIJLa6sdtHhgWMR"} -{"id":0,"country":"Albania","title":"DON XHONI - KATILE","published_at":"2022-07-07T22:00:12Z","channel_title":"DON XHONI","category_id":24,"trending_date":"22.11.07","view_count":5130167,"comment_count":3641,"_id":"s8v8iEtNxmXTaAYu"} -{"id":1,"country":"Albania","title":"Dhurata Dora x Elvana Gjata - GAJDE (Official Video)","published_at":"2022-06-30T22:00:11Z","channel_title":"Dhurata Dora","category_id":10,"trending_date":"22.11.07","view_count":8886648,"comment_count":4414,"_id":"3tyz5C4LL25k2AAf"} -{"id":2,"country":"Albania","title":"KIDA x BUTRINT IMERI - AM/PM","published_at":"2022-07-02T22:00:11Z","channel_title":"KIDA","category_id":10,"trending_date":"22.11.07","view_count":7230818,"comment_count":7518,"_id":"ZA34KAJmSOyB51xv"} -{"id":3,"country":"Albania","title":"Dafina Zeqiri - Malli","published_at":"2022-07-07T22:00:12Z","channel_title":"Dafina Zeqiri","category_id":10,"trending_date":"22.11.07","view_count":1406078,"comment_count":827,"_id":"4jGznltW2RIM3mFU"} -{"id":4,"country":"Albania","title":"Tayna x Azet - Tequila","published_at":"2022-06-30T18:00:26Z","channel_title":"Friends Entertainment","category_id":10,"trending_date":"22.11.07","view_count":6397676,"comment_count":6063,"_id":"RFVYnNLz6zxvuXw7"} -{"id":5,"country":"Albania","title":"GJIKO x FIFI - DJEGI KREJT","published_at":"2022-07-07T17:45:11Z","channel_title":"REDBOX Entertainment","category_id":10,"trending_date":"22.11.07","view_count":1695364,"comment_count":1961,"_id":"IVxzVTCKkjbtLSt5"} -{"id":6,"country":"Albania","title":"Ardian Bujupi x Ledri Vula - GELATO (prod. by Bled)","published_at":"2022-06-30T22:00:11Z","channel_title":"OfficialArdianBujupi","category_id":10,"trending_date":"22.11.07","view_count":3316092,"comment_count":1391,"_id":"L3x4QewNEA6x7h5b"} -{"id":7,"country":"Albania","title":"Capital T - Dukat (prod. Panda Music)","published_at":"2022-06-29T16:00:03Z","channel_title":"Capital T","category_id":10,"trending_date":"22.11.07","view_count":7110466,"comment_count":1230,"_id":"aSqi2V99Q6OXZNot"} -{"id":8,"country":"Albania","title":"MatoLale x Jongmen KOKAINA","published_at":"2022-07-05T16:30:27Z","channel_title":"MATOLALE","category_id":10,"trending_date":"22.11.07","view_count":1157204,"comment_count":929,"_id":"eMSRSjN20QCVJClZ"} -{"id":9,"country":"España","title":"España campeona del mundo","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"67dZ3gFoVErsLlxE"} -{"id":10,"country":"España","title":"España campeona del mundo 2","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"15JglMm2ESMxJgHV"} -{"id":10,"country":"España","title":"España campeona del mundo (put)","published_at":"2010-07-011T22:00:12Z","channel_title":"SEFutbol","category_id":2,"trending_date":"10.07.11","view_count":514000,"comment_count":3651,"_id":"15JglMm2ESMxJgHV"} -{"$$deleted":true,"_id":"15JglMm2ESMxJgHV"} -{"$$deleted":true,"_id":"3tyz5C4LL25k2AAf"} -{"$$deleted":true,"_id":"4jGznltW2RIM3mFU"} -{"$$deleted":true,"_id":"67dZ3gFoVErsLlxE"} -{"$$deleted":true,"_id":"IVxzVTCKkjbtLSt5"} -{"$$deleted":true,"_id":"L3x4QewNEA6x7h5b"} -{"$$deleted":true,"_id":"RFVYnNLz6zxvuXw7"} -{"$$deleted":true,"_id":"ZA34KAJmSOyB51xv"} -{"$$deleted":true,"_id":"aSqi2V99Q6OXZNot"} -{"$$deleted":true,"_id":"eMSRSjN20QCVJClZ"} -{"$$deleted":true,"_id":"s8v8iEtNxmXTaAYu"} diff --git a/index.js b/index.js index 82668a7..fa20e8c 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,7 @@ let api_VEG = require('./Victor/api-VEG'); let api_NRM = require('./Nico/index-api'); let dbMovies = new dataStore(); +let db = new dataStore(); let app = express(); @@ -74,6 +75,6 @@ app.get("/samples/VEG", (req, res) => { res.send(`

La media de view_count para ${paisDeseado} es: ${mediaViewCountPaisDeseado}

`); }); -api_VEG(app); +api_VEG(app, db);