Skip to content

add staticFS supports #1865

@zxysilent

Description

@zxysilent

add staticFS

Checklist

  • [x ] Dependencies installed
  • [x ] No typos
  • Searched existing issues and docs

Expected behaviour

Actual behaviour

Steps to reproduce

Working code to debug

package main

import (
	"embed"
	 "net/http"
	"github.com/labstack/echo/v4"
	"github.com/labstack/echo/v4/middleware"
)

//go:embed static
var static embed.FS
func main() {
	engine := echo.New()
	engine.Static("/static", "static")
	// use embed
	engine.StaticFS("/staticfs",http.FS(static))
	// or
	engine.StaticFS("/staticfs",static)
	engine.Start("8080")
}

Version/commit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions