Skip to content
Snippets Groups Projects

Use webpack for bundling JS libs and move Golang code related to Iframe generation there

Merged Igor Markin requested to merge feature-vcl-webpack-bundle into master
1 file
+ 23
4
Compare changes
  • Side-by-side
  • Inline
+ 23
4
package main
package main
import "fmt"
import (
 
"fmt"
 
"io/ioutil"
 
"path/filepath"
 
"strings"
 
)
func main() {
func main() {
fmt.Println("Hello, world3a.")
result := GetClientJsLibrary("https://test.org")
 
fmt.Println("Hello, world.")
 
fmt.Println(result)
}
}
func test() {
func GetClientJsLibrary(iframeUrl string) string {
fmt.Println("Test function")
path, err := filepath.Abs("../vcl/javascript/dist/viamapi-client.js")
 
 
if err != nil {
 
fmt.Println(err.Error())
 
}
 
 
dat, err := ioutil.ReadFile(path)
 
 
if err != nil {
 
fmt.Println(err.Error())
 
}
 
 
return strings.Replace(string(dat), "{{urlArg}}", iframeUrl, 1) + "\n"
}
}
Loading