Compare commits
No commits in common. "fb66f654e7d534beb58a51f77d1bfd4ed414b34e" and "d5fea7058738954b38f3751939027cc89efc5d2c" have entirely different histories.
fb66f654e7
...
d5fea70587
1 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ type ServerConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure HTTP router
|
// Configure HTTP router
|
||||||
func (config ServerConfig) router() {
|
func (config ServerConfig) router(_ http.ResponseWriter, _ *http.Request) {
|
||||||
WebConfig := plak.WebConfig{
|
WebConfig := plak.WebConfig{
|
||||||
DB: config.DB,
|
DB: config.DB,
|
||||||
UrlLength: config.UrlLength,
|
UrlLength: config.UrlLength,
|
||||||
|
@ -45,7 +45,7 @@ func Config(listenAddress string) *http.Server {
|
||||||
func (config ServerConfig) Server() {
|
func (config ServerConfig) Server() {
|
||||||
log.Println("Listening on " + config.HTTPServer.Addr)
|
log.Println("Listening on " + config.HTTPServer.Addr)
|
||||||
|
|
||||||
config.router()
|
http.HandleFunc("/", config.router)
|
||||||
|
|
||||||
log.Fatal(config.HTTPServer.ListenAndServe())
|
log.Fatal(config.HTTPServer.ListenAndServe())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue