質問編集履歴

2

追記

2018/11/05 09:34

投稿

okk
okk

スコア6

test CHANGED
File without changes
test CHANGED
@@ -8,6 +8,86 @@
8
8
 
9
9
 
10
10
 
11
+
12
+
13
+ ```json
14
+
15
+ {
16
+
17
+ "hosting": {
18
+
19
+ "public": "build",
20
+
21
+ "ignore": [
22
+
23
+ "firebase.json",
24
+
25
+ "**/.*",
26
+
27
+ "**/node_modules/**"
28
+
29
+ ],
30
+
31
+ "redirects": [{
32
+
33
+ "source": "/",
34
+
35
+ "destination": "/auth"
36
+
37
+ }],
38
+
39
+ "rewrites": [
40
+
41
+ {
42
+
43
+ "source": "**",
44
+
45
+ "function": "app"
46
+
47
+ }
48
+
49
+ ]
50
+
51
+ }
52
+
53
+ }
54
+
55
+
56
+
57
+ ```
58
+
59
+ ```node
60
+
61
+ const functions = require('firebase-functions')
62
+
63
+ const express = require('express')
64
+
65
+ const basicAuth = require('basic-auth-connect')
66
+
67
+
68
+
69
+ const app = express()
70
+
71
+
72
+
73
+ app.use(basicAuth('username', 'password'))
74
+
75
+
76
+
77
+ app.get('/auth', (req, res) => {
78
+
79
+ res.redirect('/index.html')
80
+
81
+ })
82
+
83
+
84
+
85
+ exports.app = functions.https.onRequest(app)
86
+
87
+ ```
88
+
89
+
90
+
11
91
  firebaseのfunctionsのコンソールからログを確認してみると、そもそもリダイレクトしてfunctionsの関数を通っていないようなのですが、ルーティング処理が上手くいないのは何が原因なのでしょうか。
12
92
 
13
93
 

1

修正

2018/11/05 09:34

投稿

okk
okk

スコア6

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  実装の内容としては以下リンクにあるような「basic-auth-connect」を用いたものです。
6
6
 
7
- https://gist.github.com/mkamakura/c7a57bd1bf64b017f180573adf8ba3d8
7
+ [https://gist.github.com/mkamakura/c7a57bd1bf64b017f180573adf8ba3d8](https://gist.github.com/mkamakura/c7a57bd1bf64b017f180573adf8ba3d8)
8
8
 
9
9
 
10
10