/
all.go
33 lines (26 loc) · 823 Bytes
/
all.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Package cmd - Content managed by Project Forge, see [projectforge.md] for details.
package cmd
import (
"fmt"
"github.com/muesli/coral"
"github.com/pkg/errors"
"admini.dev/admini/app/util"
)
const keyAll = "all"
func allCmd() *coral.Command {
short := fmt.Sprintf("Starts the main http server on port %d and the marketing site on port %d", util.AppPort, util.AppPort+1)
f := func(*coral.Command, []string) error { return allF() }
ret := &coral.Command{Use: keyAll, Short: short, RunE: f}
return ret
}
func allF() error {
if err := initIfNeeded(); err != nil {
return errors.Wrap(err, "error initializing application")
}
go func() {
if err := startSite(_flags.Clone(_flags.Port + 1)); err != nil {
_logger.Errorf("unable to start marketing site: %+v", err)
}
}()
return startServer(_flags)
}