- app.use("/random", new RandomAction(model))
- app.use("/doc/:namespace", new DocAction(model, modelbuilder))
- app.use("/code/:namespace", new CodeAction(model, modelbuilder))
- app.use("/search/:namespace", new SearchAction(model))
- app.use("/uml/:namespace", new UMLDiagramAction(model, mainmodule))
- app.use("/", new TreeAction(model))
-
- app.listen(host, port.to_i)
+
+ app.use_before("/*", new SessionInit)
+ app.use_before("/*", new RequestClock)
+ app.use("/api", new APIRouter(config))
+ app.use("/login", new GithubLogin(config.github_client_id))
+ app.use("/oauth", new GithubOAuthCallBack(config.github_client_id, config.github_client_secret))
+ app.use("/logout", new GithubLogout)
+ app.use("/*", new StaticHandler(toolcontext.share_dir / "nitweb", "index.html"))
+ app.use_after("/*", new ConsoleLog)
+
+ app.listen(config.app_host, config.app_port)