diff --git a/get.rest b/get.rest index 5bf2cba2e7242238920cbc87f0adcb76d654bf31..0a092833f18442cf7364d28e898dc4609ae32a1e 100644 --- a/get.rest +++ b/get.rest @@ -15,8 +15,10 @@ GET {{host}}/fruit?limit=4 HTTP/1.1 GET {{host}}/fruit?limit=3&offset=1&name=b HTTP/1.1 ### -GET {{host}}/fruit?offset=2 HTTP/1.1 +GET {{host}}/fruit?offset=3 HTTP/1.1 ### GET {{host}}/fruit HTTP/1.1 +### +GET https://apiest.herokuapp.com/fruit diff --git a/index.js b/index.js index 50ac45377b84ba116c5948c4f4368a8c0924db36..d114ccf63d2a22739f52f914967abf4f76ba27e9 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,7 @@ const parse_qs = ( qs_object_input, model_input ) => { } if( query_object.colors ){ - + results = results.filter( fruit => fruit.colors.some( c => query_object.colors.includes(c) diff --git a/package.json b/package.json index 1c1859bad6a0a9c72e8f67ac5cea26734b88a101..b9dd992c6031181544ef6e1544b08672015938c9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node ." }, "keywords": [], "author": "",