main.go 675 Bytes
Newer Older
1
2
3
4
5
6
7
8
package main

import (
	"fmt"
	"os"
	"strconv"

	"github.com/go-errors/errors"
Sietse Ringers's avatar
Sietse Ringers committed
9
10
	"github.com/privacybydesign/irmago/server"
	"github.com/privacybydesign/irmago/server/irmaserver"
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
)

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
	}

Sietse Ringers's avatar
Sietse Ringers committed
34
35
	err = irmaserver.Start(&irmaserver.Configuration{
		Configuration: &server.Configuration{
36
37
38
			IrmaConfigurationPath: os.Args[2],
		},
		Port: port,
39
40
	})
}