Add functions and search page

This commit is contained in:
2019-06-12 21:47:36 +09:00
parent 931ec5472c
commit 684d786e36
23 changed files with 4330 additions and 36 deletions

21
functions/src/index.ts Normal file
View File

@ -0,0 +1,21 @@
import * as functions from 'firebase-functions';
import * as request from 'request';
// // Start writing Firebase Functions
// // https://firebase.google.com/docs/functions/typescript
//
// export const helloWorld = functions.https.onRequest((request, response) => {
// response.send("Hello from Firebase!");
// });
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 );
// } );
} );