main.go 621 Bytes
Newer Older
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
34
35
36
37
package main

import (
	"fmt"
	"os"
	"strconv"

	"github.com/go-errors/errors"
	"github.com/privacybydesign/irmago/irmaserver"
	"github.com/privacybydesign/irmago/irmaserver/server"
)

func main() {
	var err error
	defer func() {
		if err != nil {
			fmt.Println(err.Error())
			os.Exit(1)
		}
		os.Exit(0)
	}()

	if len(os.Args) != 3 {
		err = errors.New("Usage: irmaserver port path")
		return
	}

	port, err := strconv.Atoi(os.Args[1])
	if err != nil {
		err = errors.New("First argument must be an integer")
		return
	}

	err = server.Start(port, &irmaserver.Configuration{
		IrmaConfigurationPath: os.Args[2],
	})
}