0
0

More than 3 years have passed since last update.

echoのWrapHandlerを使ってnet/httpで作られた関数をそのまま使う

Posted at

使い方

  • echo.WrapHandler(http.HandlerFunc(Redirect))のような感じで使う

ソース

package main

import (
    "net/http"

    "github.com/labstack/echo"
)

func main() {
    e := echo.New()

    e.GET("/", echo.WrapHandler(http.HandlerFunc(Redirect)))
    e.Logger.Fatal(e.Start(":1323"))
}

func Redirect(w http.ResponseWriter, r *http.Request) {
    http.Redirect(w, r, "https://vamdemicsystem.black", http.StatusFound)
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0