-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
46 lines (36 loc) · 839 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
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
// "flag"
// "fmt"
// "net/http"
"flag"
"fmt"
"net/http"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/exploit-rs/nerd/frontend"
"github.com/exploit-rs/nerd/server"
)
func main() {
devMode := false
flag.BoolVar(&devMode, "dev", devMode, "enable dev mode")
flag.Parse()
e := echo.New()
e.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "Welcome to Exploit.RS!")
})
e.GET("/api/status", func(c echo.Context) error {
s := server.Status{
Name: "Jukan",
Text: "command test hahaha",
}
return c.JSON(http.StatusOK, s)
})
// e.Static("/", "kkkkkkkkkkk")
frontend.PrintFsys()
if devMode {
e.Use(middleware.CORSWithConfig(server.Cors()))
fmt.Println("Server running in dev mode")
}
e.Logger.Fatal(e.Start(":1337"))
}