aboutsummaryrefslogtreecommitdiffhomepage
path: root/worker/swift/main.go
blob: 21a94641c4cf56be56384482a9cf8b49e352d2ac (plain)
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
package main

import (
	"log"
	"net/http"

	"github.com/labstack/echo/v4"
	"github.com/labstack/echo/v4/middleware"
)

func main() {
	if err := prepareDirectories(); err != nil {
		log.Fatal(err)
	}

	e := echo.New()

	e.Use(middleware.Logger())
	e.Use(middleware.Recover())

	e.POST("/exec", handleExec)

	if err := e.Start(":80"); err != http.ErrServerClosed {
		log.Fatal(err)
	}
}