// [START functionsimport] const functions = require('firebase-functions'); const express = require('express'); const mock = require('./mock/index'); const app = express(); const sendData = (body, req, res) => { if (!body) { res.send('test'); return ''; } if ('$body' in body) { res.send(body.$body); return; } if (typeof body === 'function') { body(req, res); } res.send(body); }; app.get('/api', (req, res) => { const html = Object.keys(mock).map(url => { return `
${url}