rolling back from previous implementation, now using master version of unoconv

This commit is contained in:
Julien Neuhart
2019-09-26 18:07:43 +02:00
parent 88f74d5e9c
commit 24e6a86bf5
47 changed files with 346 additions and 3034 deletions

View File

@@ -1,14 +1,15 @@
package main
import (
"context"
"fmt"
"net/http"
"os"
"os/signal"
"github.com/thecodingmachine/gotenberg/internal/app/xhttp"
"github.com/thecodingmachine/gotenberg/internal/pkg/chrome"
"github.com/thecodingmachine/gotenberg/internal/pkg/conf"
"github.com/thecodingmachine/gotenberg/internal/pkg/prinery"
"github.com/thecodingmachine/gotenberg/internal/pkg/xcontext"
"github.com/thecodingmachine/gotenberg/internal/pkg/xlog"
)
@@ -26,18 +27,14 @@ func main() {
}
systemLogger.InfofOp(op, "Gotenberg %s", version)
systemLogger.DebugfOp(op, "configuration: %+v", config)
// create our prinery.
prinry, err := prinery.NewPM2Prinery(systemLogger, config)
// start Google Chrome.
// TODO kill proc.
_, err = chrome.Start(context.Background(), systemLogger)
if err != nil {
systemLogger.FatalOp(op, err)
}
// TODO use chan
// TODO stop prinery
if err = prinry.Start(make(chan error, 1)); err != nil {
systemLogger.FatalOp(op, err)
}
// create our API.
srv := xhttp.New(config, prinry)
srv := xhttp.New(config)
// run our API in a goroutine so that it doesn't block.
go func() {
systemLogger.InfofOp(op, "http server started on port '%d'", config.DefaultListenPort())