-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
34 lines (31 loc) · 661 Bytes
/
main.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
34
package main
import (
"fmt"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/rwandaopensource/igazeti/internal/handlers"
"github.com/rwandaopensource/igazeti/internal/pdf"
)
func main() {
server := http.Server{
Addr: ":https",
ReadHeaderTimeout: time.Second,
Handler: handlers.Handler(),
}
go func() {
err := server.ListenAndServe()
if err != nil && err != http.ErrServerClosed {
log.Println(err)
}
}()
sig := make(chan os.Signal, 2)
signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM)
s, _ := pdf.ExctractAll("internal/pdf/constitution_2015.pdf")
fmt.Println(s)
<-sig;
server.Close()
}