webapi: Move package to internal.
2
.gitignore
vendored
@ -23,7 +23,7 @@ vspd-harness/
|
|||||||
cov.out
|
cov.out
|
||||||
*cpu.out
|
*cpu.out
|
||||||
*mem.out
|
*mem.out
|
||||||
webapi/test.db
|
internal/webapi/test.db
|
||||||
database/test.db
|
database/test.db
|
||||||
|
|
||||||
# Go workspace
|
# Go workspace
|
||||||
|
|||||||
@ -16,9 +16,9 @@ import (
|
|||||||
"github.com/decred/dcrd/wire"
|
"github.com/decred/dcrd/wire"
|
||||||
"github.com/decred/slog"
|
"github.com/decred/slog"
|
||||||
"github.com/decred/vspd/database"
|
"github.com/decred/vspd/database"
|
||||||
|
"github.com/decred/vspd/internal/webapi"
|
||||||
"github.com/decred/vspd/rpc"
|
"github.com/decred/vspd/rpc"
|
||||||
"github.com/decred/vspd/version"
|
"github.com/decred/vspd/version"
|
||||||
"github.com/decred/vspd/webapi"
|
|
||||||
"github.com/jrick/wsrpc/v2"
|
"github.com/jrick/wsrpc/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 905 B After Width: | Height: | Size: 905 B |
|
Before Width: | Height: | Size: 805 B After Width: | Height: | Size: 805 B |
|
Before Width: | Height: | Size: 1009 B After Width: | Height: | Size: 1009 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 842 B After Width: | Height: | Size: 842 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 473 B |
@ -213,7 +213,7 @@ func (s *Server) router(cookieSecret []byte, dcrd rpc.DcrdConnect, wallets rpc.W
|
|||||||
"comma": humanize.Comma,
|
"comma": humanize.Comma,
|
||||||
})
|
})
|
||||||
|
|
||||||
router.LoadHTMLGlob("webapi/templates/*.html")
|
router.LoadHTMLGlob("internal/webapi/templates/*.html")
|
||||||
|
|
||||||
// Recovery middleware handles any go panics generated while processing web
|
// Recovery middleware handles any go panics generated while processing web
|
||||||
// requests. Ensures a 500 response is sent to the client rather than
|
// requests. Ensures a 500 response is sent to the client rather than
|
||||||
@ -227,7 +227,7 @@ func (s *Server) router(cookieSecret []byte, dcrd rpc.DcrdConnect, wallets rpc.W
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Serve static web resources
|
// Serve static web resources
|
||||||
router.Static("/public", "webapi/public/")
|
router.Static("/public", "internal/webapi/public/")
|
||||||
|
|
||||||
// Create a cookie store for persisting admin session information.
|
// Create a cookie store for persisting admin session information.
|
||||||
cookieStore := sessions.NewCookieStore(cookieSecret)
|
cookieStore := sessions.NewCookieStore(cookieSecret)
|
||||||