mirror of
https://github.com/taigrr/shorturl
synced 2025-01-18 04:03:16 -08:00
Removed unused config
This commit is contained in:
parent
489d647a6f
commit
d4b2e6eac8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
*.db
|
||||
shorturl
|
||||
|
9
Makefile
9
Makefile
@ -3,11 +3,14 @@
|
||||
all: dev
|
||||
|
||||
dev: build
|
||||
./shorturl -bind 127.0.0.1:8000
|
||||
./shorturl
|
||||
|
||||
build: clean
|
||||
go get ./...
|
||||
go build -o ./shorturl .
|
||||
go build .
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
clean:
|
||||
rm -rf bin shorturl
|
||||
rm -rf shorturl
|
||||
|
@ -1,13 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestZeroConfig(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
cfg := Config{}
|
||||
}
|
5
main.go
5
main.go
@ -8,8 +8,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
db *bolt.DB
|
||||
cfg Config
|
||||
db *bolt.DB
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -31,5 +30,5 @@ func main() {
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
NewServer(bind, cfg).ListenAndServe()
|
||||
NewServer(bind).ListenAndServe()
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ import (
|
||||
// Server ...
|
||||
type Server struct {
|
||||
bind string
|
||||
config Config
|
||||
templates *templice.Template
|
||||
router *httprouter.Router
|
||||
}
|
||||
@ -82,10 +81,9 @@ func (s *Server) initRoutes() {
|
||||
}
|
||||
|
||||
// NewServer ...
|
||||
func NewServer(bind string, config Config) *Server {
|
||||
func NewServer(bind string) *Server {
|
||||
server := &Server{
|
||||
bind: bind,
|
||||
config: config,
|
||||
router: httprouter.New(),
|
||||
templates: templice.New(rice.MustFindBox("templates")),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user