1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-14 18:27:25 +08:00
docker-labs/handlers/new_session.go
Jonathan Leibiusky (@xetorthio) dde49d8700 Initial commit
2016-10-08 03:12:48 +02:00

20 lines
356 B
Go

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)
}
}