Ajouter routes exemples selon figma #25
1 changed files with 41 additions and 0 deletions
41
server.go
41
server.go
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"io"
|
||||
"net/http"
|
||||
|
@ -51,6 +52,20 @@ func Execute() {
|
|||
|
||||
e.GET("/", handleIndex)
|
||||
|
||||
e.GET("/a-propos", handleAPropos)
|
||||
|
||||
e.GET("/actualite", handleActualite)
|
||||
|
||||
e.GET("/actualite/:article", handleActualiteArticle)
|
||||
|
||||
e.GET("/vie-etudiante", handleVieEtudiante)
|
||||
|
||||
e.GET("/vie-etudiante/:organisme", handleVieEtudianteOrganisme)
|
||||
|
||||
e.GET("/documentation", handleDocumentation)
|
||||
|
||||
e.GET("/formulaires", handleFormulaires)
|
||||
|
||||
e.Logger.Fatal(e.Start(":8080"))
|
||||
}
|
||||
|
||||
|
@ -74,6 +89,32 @@ func handleIndex(c echo.Context) error {
|
|||
return c.Render(http.StatusOK, "index-html", nil)
|
||||
}
|
||||
|
||||
func handleAPropos(c echo.Context) error {
|
||||
return c.String(http.StatusOK, "À Propos")
|
||||
}
|
||||
|
||||
func handleActualite(c echo.Context) error {
|
||||
return c.String(http.StatusOK, "Actualité")
|
||||
}
|
||||
|
||||
func handleActualiteArticle(c echo.Context) error {
|
||||
article := c.Param("article")
|
||||
return c.String(http.StatusOK, fmt.Sprintf("Article: %s", article))
|
||||
}
|
||||
func handleVieEtudiante(c echo.Context) error {
|
||||
return c.String(http.StatusOK, "Vie Étudiante")
|
||||
}
|
||||
func handleVieEtudianteOrganisme(c echo.Context) error {
|
||||
organisme := c.Param("organisme")
|
||||
return c.String(http.StatusOK, fmt.Sprintf("Organisme: %s", organisme))
|
||||
}
|
||||
func handleDocumentation(c echo.Context) error {
|
||||
return c.String(http.StatusOK, "Documentation")
|
||||
}
|
||||
func handleFormulaires(c echo.Context) error {
|
||||
return c.String(http.StatusOK, "Formulaires")
|
||||
}
|
||||
|
||||
// CSS Handlers
|
||||
|
||||
func handleStaticCSSIndex(c echo.Context) error {
|
||||
|
|
Loading…
Reference in a new issue