Displaying a response to user after posting form data
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"fmt"
|
||||
"go-udemy-web-1/internal/config"
|
||||
"go-udemy-web-1/internal/handlers"
|
||||
"go-udemy-web-1/internal/models"
|
||||
"go-udemy-web-1/internal/render"
|
||||
"log"
|
||||
"net/http"
|
||||
@ -21,6 +23,9 @@ var (
|
||||
|
||||
// main is the main application function
|
||||
func main() {
|
||||
// what am I going to put in the session
|
||||
gob.Register(models.Reservation{})
|
||||
|
||||
// change this to true when in production
|
||||
app.InProduction = false
|
||||
|
||||
|
@ -27,6 +27,7 @@ func routes(app *config.AppConfig) http.Handler {
|
||||
mux.Post("/availability-json", handlers.Repo.AvailabilityJSON)
|
||||
mux.Get("/make-reservation", handlers.Repo.MakeReservation)
|
||||
mux.Post("/make-reservation", handlers.Repo.PostMakeReservation)
|
||||
mux.Get("/reservation-summary", handlers.Repo.ReservationSummary)
|
||||
|
||||
fileServer := http.FileServer(http.Dir("./static/"))
|
||||
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))
|
||||
|
Reference in New Issue
Block a user