Skip to content

ddo/go-vue-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-vue-handler

Vue Router history mode with Golang

installation

go get -u github.com/ddo/go-vue-handler

usage

  • build vue app to get index.html and dist folder
  • serve it as a static folder with go server
  • all the static files must has extension

example

/
    public/
        dist
        index.html
    server.go
package main

import (
	"net/http"

	"github.com/ddo/go-vue-handler"
)

const (
	port = "8080"
	publicDir = "./public"
)

func main() {
	server := &http.Server{
		Addr:    ":" + port,
		Handler: vue.Handler(publicDir),
	}
	err := server.ListenAndServe()
	panic(err)
}

About

Host Vue app with Router history mode in Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy