mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 01:57:32 +08:00
20 lines
354 B
Go
20 lines
354 B
Go
package handlers
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/franela/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)
|
|
}
|
|
}
|