From 9347c36883955f771158985d0e2f8dba7ac85efe Mon Sep 17 00:00:00 2001 From: Mathieu Sanchez Date: Wed, 12 Jun 2019 22:24:25 +0900 Subject: [PATCH] Send default data on production mode --- functions/src/index.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/functions/src/index.ts b/functions/src/index.ts index 6f302d6..5efd99a 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -1,5 +1,4 @@ import * as functions from 'firebase-functions'; -import * as request from 'request'; // // Start writing Firebase Functions // // https://firebase.google.com/docs/functions/typescript @@ -10,12 +9,8 @@ import * as request from 'request'; export const search = functions.https.onRequest( ( req, res ) => { - request( 'http://142.4.212.26:8080/search?s=' + req.params[0], ( error, response, body ) => { - res.send( body ); - } ); - // request.get( 'http://142.4.212.26:8080/search?s=' + req.query.s ).on( "error", ( data ) => { - // res.send( data ); - // } ).on( "response", ( data ) => { - // res.send( data ); + res.send( '[{"tfidf":"0.0052","url":"https://www.skysports.com/share/11740401"},{"tfidf":"0.0023","url":"https://www.skysports.com/share/11740370"},{"tfidf":"0.0021","url":"https://www.skysports.com/share/11740366"},{"tfidf":"0","url":"https://www.skysports.com/share/11740338"},{"tfidf":"0.0012","url":"https://www.skysports.com/share/11740227"},{"tfidf":"0.0038","url":"https://www.skysports.com/share/11740400"},{"tfidf":"0","url":"https://www.skysports.com/share/11728937"},{"tfidf":"0","url":"https://www.skysports.com/share/11731660"},{"tfidf":"0.0007","url":"https://www.skysports.com/share/11739856"},{"tfidf":"0.0035","url":"https://www.skysports.com/share/11740171"},{"tfidf":"0.0007","url":"https://www.skysports.com/share/11740333"},{"tfidf":"0.0009","url":"https://www.skysports.com/share/11709253"},{"tfidf":"0","url":"https://www.skysports.com/share/11709512"},{"tfidf":"0","url":"https://www.skysports.com/share/11713244"},{"tfidf":"0","url":"https://www.skysports.com/share/11740141"}]' ); + // request( 'http://142.4.212.26:8080/search?s=' + req.params[0], ( error, response, body ) => { + // res.send( body ); // } ); } );