Skip to content

Commit c6280e4

Browse files
author
Zachary Seguin
committed
fix(notebooks): Return index.html when the new page is requested
1 parent 73fafd8 commit c6280e4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net/http"
99
"os"
1010
"os/signal"
11+
"path"
1112
"path/filepath"
1213
"sync"
1314
"time"
@@ -183,6 +184,12 @@ func main() {
183184
},
184185
}, s.GetPodDefaults)).Methods("GET")
185186

187+
// Return the index.html page when a request for the new page is received directly.
188+
router.Path("/new").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
189+
http.ServeFile(w, r, path.Join(staticDirectory, "index.html"))
190+
})
191+
192+
// Serve the rest of the routes from the static directory.
186193
router.PathPrefix("/").Handler(http.FileServer(http.Dir(staticDirectory)))
187194

188195
// Setup the server, with:

0 commit comments

Comments
 (0)