frontend: Add a registration process
This commit is contained in:
parent
61f96a643c
commit
97386a5d6f
2 changed files with 42 additions and 4 deletions
|
@ -32,6 +32,7 @@ func main() {
|
|||
var start = flag.Int64("start", 0, fmt.Sprintf("Challenge start timestamp (in 2 minutes: %d)", time.Now().Unix()/60*60+120))
|
||||
var duration = flag.Duration("duration", 180*time.Minute, "Challenge duration")
|
||||
var denyChName = flag.Bool("denyChName", false, "Deny team to change their name")
|
||||
var allowRegistration = flag.Bool("allowRegistration", false, "New team can add itself")
|
||||
flag.StringVar(&TeamsDir, "teams", "../TEAMS", "Base directory where save teams JSON files")
|
||||
flag.StringVar(&SubmissionDir, "submission", "./submissions/", "Base directory where save submissions")
|
||||
flag.Parse()
|
||||
|
@ -66,7 +67,7 @@ func main() {
|
|||
|
||||
log.Println("Registering handlers...")
|
||||
http.Handle(fmt.Sprintf("%s/time.json", *prefix), http.StripPrefix(*prefix, TimeHandler{startTime, *duration}))
|
||||
http.Handle(fmt.Sprintf("%s/", *prefix), http.StripPrefix(*prefix, SubmissionHandler{end, *denyChName}))
|
||||
http.Handle(fmt.Sprintf("%s/", *prefix), http.StripPrefix(*prefix, SubmissionHandler{end, *denyChName, *allowRegistration}))
|
||||
|
||||
log.Println(fmt.Sprintf("Ready, listening on %s", *bind))
|
||||
if err := http.ListenAndServe(*bind, nil); err != nil {
|
||||
|
|
Reference in a new issue