| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
303 バイト追加 、 2020年11月2日 (月) 15:12
#Hostingに対してカスタムドメインを設定
#firebase.json の hosting の rewrite に functions を追加
 
*Functions
<pre>
import * as functions from 'firebase-functions';
import * as express from 'express';
 
const app: express.Express = express();
 
router.get('/api/test', (req, res) => {
res.send('TEST!');
});
 
export const apiService = functions.https.onRequest(app);
</pre>
*firebase.json
<pre>
"hosting": [
: 省略
"rewrites": [
{ "source": "/api/**", "function": "apiapiService"
},
{
"destination": "/index.html"
}
]
}
]
</pre>

案内メニュー