forked from songquanpeng/gin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b188e93
commit 094d1e4
Showing
34 changed files
with
62 additions
and
2,076 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,2 @@ | ||
# React Template | ||
# Gin React Template | ||
|
||
## Basic Usages | ||
```shell | ||
# Runs the app in the development mode | ||
npm start | ||
|
||
# Builds the app for production to the `build` folder | ||
npm run build | ||
``` | ||
|
||
## Reference | ||
https://github.com/OIerDb-ng/OIerDb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package common | ||
|
||
import ( | ||
"embed" | ||
"github.com/gin-gonic/contrib/static" | ||
"io/fs" | ||
"net/http" | ||
) | ||
|
||
// Credit: https://github.com/gin-contrib/static/issues/19 | ||
|
||
type embedFileSystem struct { | ||
http.FileSystem | ||
} | ||
|
||
func (e embedFileSystem) Exists(prefix string, path string) bool { | ||
_, err := e.Open(path) | ||
if err != nil { | ||
return false | ||
} | ||
return true | ||
} | ||
|
||
func EmbedFolder(fsEmbed embed.FS, targetPath string) static.ServeFileSystem { | ||
efs, err := fs.Sub(fsEmbed, targetPath) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return embedFileSystem{ | ||
FileSystem: http.FS(efs), | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.