flux init

This commit is contained in:
Zoe
2024-12-09 05:58:50 -06:00
parent 85718a135b
commit 1dbb689860
6 changed files with 17 additions and 12 deletions

4
.fluxignore Normal file
View File

@@ -0,0 +1,4 @@
.git
public/uploads/
passport
passport.db*

2
.gitignore vendored
View File

@@ -1,6 +1,6 @@
passport
.env
passport.db
passport.db*
public/uploads/
zqdgr
assets/tailwind.css

6
flux.json Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "passport",
"port": 3000,
"env_file": ".env",
"url": "passport.wildcardproject.com"
}

View File

@@ -39,7 +39,7 @@ import (
//go:embed assets/** templates/** schema.sql
var embeddedAssets embed.FS
var devContent string = `<script>
var devContent = `<script>
let host = window.location.hostname;
const socket = new WebSocket('ws://' + host + ':2067/ws');
@@ -571,7 +571,10 @@ func main() {
})
engine.AddFunc("devContent", func() string {
if os.Getenv("PASSPORT_DEV_MODE") == "true" {
return devContent
}
return ""
})
router := fiber.New(fiber.Config{

View File

@@ -1,8 +0,0 @@
//go:build prod
// +build prod
package main
func init() {
devContent = ``
}

View File

@@ -10,7 +10,7 @@
"url": "https://github.com/juls0730/passport.git"
},
"scripts": {
"dev": "go generate; go run main.go",
"dev": "go generate; PASSPORT_DEV_MODE=true go run main.go",
"build": "go generate && go build -tags netgo,prod -o passport"
},
"pattern": "**/*.go,views/**/*.hbs,styles/**/*.css,assets/**/*.{svg,png,jpg,jpeg,webp,woff2,ttf,otf,eot,ico,gif,webp}"