Skip to content

Commit

Permalink
local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Dec 20, 2023
1 parent 1c1c7b7 commit 8fa2c44
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
oauth
docker-compose.override.yml
1 change: 1 addition & 0 deletions cmd/localdev/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
localdev
16 changes: 16 additions & 0 deletions cmd/localdev/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
"fmt"
"net/http"
)

func main() {
fmt.Println("Starting")

server := &http.Server{Addr: ":8080", Handler: nil}
err := server.ListenAndServe()
if err != nil {
panic(err)
}
}
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3.6"

services:
oauth:
image: golang:1.21.4
- ".:/data"
- "go_dir:/go"
- "go_cache:/.cache"
environment:
- BASE_URL=http://localhost:8080
ports:
- "8080:8080"
working_dir: /data
command: ["go", "run", "./cmd/localdev"]

volumes:
go_cache: {}
go_dir: {}
4 changes: 4 additions & 0 deletions handler_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ func ExampleOauthHandler() {
// navigate the user to the login-url
fmt.Printf("Login-URL: '%s'", handler.LoginURL())

// start webserver
server := &http.Server{Addr: ":8080", Handler: nil}
server.ListenAndServe()

// profit?
}

0 comments on commit 8fa2c44

Please sign in to comment.