Merge pull request 'Ajouter routes exemples selon figma' (#25) from feature/squelette-routes into main

Reviewed-on: #25
This commit is contained in:
Victor Lacasse-Beaudoin 2023-03-24 17:28:36 -05:00
commit 2bb5e267c8

View file

@ -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 {