MCPcopy Index your code
hub / github.com/coder/coder / startServer

Function startServer

scripts/develop/main.go:768–796  ·  view source on GitHub ↗
(cfg *devConfig, group *procGroup)

Source from the content-addressed store, hash-verified

766}
767
768func startServer(cfg *devConfig, group *procGroup) error {
769 serverArgs := []string{
770 "--global-config", cfg.configDir,
771 "server",
772 "--http-address", fmt.Sprintf("0.0.0.0:%d", cfg.apiPort),
773 "--swagger-enable",
774 "--dangerous-allow-cors-requests=true",
775 "--enable-terraform-debug-mode",
776 }
777 if cfg.accessURL != "" {
778 // Setting access url to `""` enables a `try.coder.app` url
779 serverArgs = append(serverArgs, "--access-url", cfg.accessURL)
780 }
781 if cfg.coderMetricsPort != 0 {
782 serverArgs = append(serverArgs,
783 "--prometheus-enable",
784 "--prometheus-address", fmt.Sprintf("0.0.0.0:%d", cfg.coderMetricsPort),
785 "--prometheus-collect-agent-stats",
786 "--prometheus-collect-db-metrics",
787 )
788 }
789 serverArgs = append(serverArgs, cfg.serverExtraArgs...)
790
791 if cfg.debug {
792 return startServerDebug(cfg, serverArgs, group)
793 }
794 cmd := cfg.cmd(group.Ctx(), cfg.binaryPath, serverArgs...)
795 return group.Start("api", cmd)
796}
797
798func startServerDebug(cfg *devConfig, serverArgs []string, group *procGroup) error {
799 ctx := group.Ctx()

Callers 1

developFunction · 0.85

Calls 4

startServerDebugFunction · 0.85
cmdMethod · 0.80
CtxMethod · 0.80
StartMethod · 0.65

Tested by

no test coverage detected