Add port option
This commit is contained in:
commit
3e3aef20c8
9 changed files with 15 additions and 7 deletions
|
@ -11,4 +11,4 @@ WORKDIR /src/oef/
|
||||||
RUN go build -o oef *.go
|
RUN go build -o oef *.go
|
||||||
ENTRYPOINT ["/src/oef/oef"]
|
ENTRYPOINT ["/src/oef/oef"]
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 80
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
0.4.2-11-g359f295-master
|
0.4.3-7-g38a4224-master
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
url: "https://gara.olimpiadi-economiaefinanza.it"
|
url: "https://gara.olimpiadi-economiaefinanza.it"
|
||||||
|
port: "80"
|
||||||
domain: "olimpiadi-economiaefinanza.it"
|
domain: "olimpiadi-economiaefinanza.it"
|
||||||
log_level: 2
|
log_level: 2
|
||||||
language: "it"
|
language: "it"
|
||||||
jwt_expire_time: 120
|
jwt_expire_time: 120
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
allow_session_url_query: true
|
||||||
|
|
||||||
keys:
|
keys:
|
||||||
cookie_store_key: "2a=UvD!"
|
cookie_store_key: "2a=UvD!"
|
||||||
jwt_signing_key: "ytOC>3,"
|
jwt_signing_key: "ytOC>3,"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
url: "http://localhost:3000"
|
url: "http://localhost:3000"
|
||||||
|
port: "3000"
|
||||||
log_level: 2
|
log_level: 2
|
||||||
language: "it"
|
language: "it"
|
||||||
|
|
||||||
|
@ -28,4 +29,4 @@ smtp:
|
||||||
username: ""
|
username: ""
|
||||||
password: ""
|
password: ""
|
||||||
from: "no-reply@olimpiadi-economiaefinanza.it"
|
from: "no-reply@olimpiadi-economiaefinanza.it"
|
||||||
bcc: "bcc@fake.org"
|
bcc: "bcc@fake.org"
|
||||||
|
|
|
@ -35,6 +35,7 @@ type ConfigT struct {
|
||||||
// Domain
|
// Domain
|
||||||
|
|
||||||
Url string
|
Url string
|
||||||
|
Port string
|
||||||
Domain string
|
Domain string
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
url: "http://localhost:3000"
|
url: "http://localhost:3000"
|
||||||
|
port: "3000"
|
||||||
log_level: 2
|
log_level: 2
|
||||||
language: "it"
|
language: "it"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
url: "http://oef_regression_test:3000"
|
url: "http://oef_regression_test"
|
||||||
|
port: "3000"
|
||||||
log_level: 2
|
log_level: 2
|
||||||
language: "it"
|
language: "it"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
url: "http://localhost:3000"
|
url: "http://localhost:3000"
|
||||||
|
port: "3000"
|
||||||
log_level: 2
|
log_level: 2
|
||||||
language: "it"
|
language: "it"
|
||||||
jwt_expire_time: 60
|
jwt_expire_time: 60
|
||||||
|
|
5
main.go
5
main.go
|
@ -71,8 +71,6 @@ func main() {
|
||||||
defer profile.Start().Stop()
|
defer profile.Start().Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("OEF is listening to port 3000...")
|
|
||||||
|
|
||||||
htmlRenderer, err := renderer.NewHTMLRenderer("templates")
|
htmlRenderer, err := renderer.NewHTMLRenderer("templates")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -116,7 +114,8 @@ func main() {
|
||||||
conf.Handlers.PathPatterns = oef_handlers.DefaultPathPatterns
|
conf.Handlers.PathPatterns = oef_handlers.DefaultPathPatterns
|
||||||
conf.Handlers.APIPathPatterns = oef_handlers.DefaultAPIPathPatterns
|
conf.Handlers.APIPathPatterns = oef_handlers.DefaultAPIPathPatterns
|
||||||
|
|
||||||
if err := http.ListenAndServe(":3000", handlers.LoggingHandler(os.Stdout, oef_handlers.NewHandlers(
|
log.Printf("OEF is listening to port %s...", conf.Port)
|
||||||
|
if err := http.ListenAndServe(":"+conf.Port, handlers.LoggingHandler(os.Stdout, oef_handlers.NewHandlers(
|
||||||
conf,
|
conf,
|
||||||
renderer,
|
renderer,
|
||||||
db,
|
db,
|
||||||
|
|
Loading…
Reference in a new issue