mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-05 09:53:21 +08:00
Initial commit
This commit is contained in:
19
handlers/new_session.go
Normal file
19
handlers/new_session.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/xetorthio/play-with-docker/services"
|
||||
)
|
||||
|
||||
func NewSession(rw http.ResponseWriter, req *http.Request) {
|
||||
s, err := services.NewSession()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
//TODO: Return some error code
|
||||
} else {
|
||||
http.Redirect(rw, req, fmt.Sprintf("/p/%s", s.Id), http.StatusFound)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user