@@ -43,7 +43,7 @@ func Handler(fileSystem fs.FS, options *Options) http.Handler {
43
43
router := chi .NewRouter ()
44
44
45
45
// Build up a router that matches NextJS routing rules, for HTML files
46
- buildRouter (router , fileSystem , * options )
46
+ registerRoutes (router , fileSystem , * options )
47
47
48
48
// Fallback to static file server for non-HTML files
49
49
// Non-HTML files don't have special routing rules, so we can just leverage
@@ -57,9 +57,9 @@ func Handler(fileSystem fs.FS, options *Options) http.Handler {
57
57
return router
58
58
}
59
59
60
- // buildRouter recursively traverses the file-system, building routes
60
+ // registerRoutes recursively traverses the file-system, building routes
61
61
// as appropriate for respecting NextJS dynamic rules.
62
- func buildRouter (rtr chi.Router , fileSystem fs.FS , options Options ) {
62
+ func registerRoutes (rtr chi.Router , fileSystem fs.FS , options Options ) {
63
63
files , err := fs .ReadDir (fileSystem , "." )
64
64
if err != nil {
65
65
options .Logger .Warn (context .Background (), "Provided filesystem is empty; unable to build routes" )
@@ -92,9 +92,9 @@ func buildRouter(rtr chi.Router, fileSystem fs.FS, options Options) {
92
92
routeName = "{dynamic}"
93
93
}
94
94
95
- options .Logger .Debug (context .Background (), "Adding route" , slog .F ("name" , name ), slog .F ("routeName" , routeName ))
95
+ options .Logger .Debug (context .Background (), "Registering route" , slog .F ("name" , name ), slog .F ("routeName" , routeName ))
96
96
rtr .Route ("/" + routeName , func (r chi.Router ) {
97
- buildRouter (r , sub , options )
97
+ registerRoutes (r , sub , options )
98
98
})
99
99
}
100
100
}
0 commit comments