Skip to content
Snippets Groups Projects
Commit fdfeeae5 authored by Markin Igor's avatar Markin Igor
Browse files

Add function providing viamapi-client.js library.

parent c77e8b66
No related branches found
No related tags found
1 merge request!4Use webpack for bundling JS libs and move Golang code related to Iframe generation there
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"
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment