-
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.
Make dev mode and prod mode both work.
- Loading branch information
Showing
9 changed files
with
102 additions
and
45 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 |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
/_notes.yaml | ||
local | ||
node_modules | ||
/backend/config.json | ||
/backend/public | ||
/backend/js |
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,31 @@ | ||
package noport | ||
|
||
import ( | ||
"embed" | ||
"io/fs" | ||
"net/http" | ||
|
||
"github.com/gin-contrib/static" | ||
) | ||
|
||
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 { | ||
fsys, err := fs.Sub(fsEmbed, targetPath) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return embedFileSystem{ | ||
FileSystem: http.FS(fsys), | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
{ :main noport.main } | ||
{ :main noport.main | ||
:output-to "target/public/js/noport.js" } |
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 was deleted.
Oops, something went wrong.
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,3 @@ | ||
{ :main noport.main | ||
:optimizations :advanced | ||
:output-to "target/public/js/noport.js" } |
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