mirror of
https://github.com/arnaucube/blogo.git
synced 2026-02-07 03:46:40 +01:00
http server using relativePath
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
9
main.go
9
main.go
@@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/gomarkdown/markdown/parser"
|
"github.com/gomarkdown/markdown/parser"
|
||||||
)
|
)
|
||||||
|
|
||||||
const version = "v0_20220503"
|
const version = "v0_20220513"
|
||||||
const directory = "blogo-input"
|
const directory = "blogo-input"
|
||||||
const defaultOutputDir = "public"
|
const defaultOutputDir = "public"
|
||||||
|
|
||||||
@@ -37,9 +37,10 @@ func main() {
|
|||||||
|
|
||||||
// serve files
|
// serve files
|
||||||
fs := http.FileServer(http.Dir(config.OutputDir))
|
fs := http.FileServer(http.Dir(config.OutputDir))
|
||||||
fmt.Printf("Blog being served in: \n http://127.0.0.1:%s\n http://localhost:%s\n",
|
http.Handle(config.RelativePath+"/", http.StripPrefix(config.RelativePath, fs))
|
||||||
*port, *port)
|
fmt.Printf("Blog being served in: \n http://127.0.0.1:%s%s\n http://localhost:%s%s\n",
|
||||||
log.Fatal(http.ListenAndServe(":"+*port, fs))
|
*port, config.RelativePath, *port, config.RelativePath)
|
||||||
|
log.Fatal(http.ListenAndServe(":"+*port, nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateHTML() {
|
func generateHTML() {
|
||||||
|
|||||||
Reference in New Issue
Block a user