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
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
package main
import "fmt"
import (
"fmt"
"io/ioutil"
"path/filepath"
"strings"
)
func main() {
fmt.Println("Hello, world3a.")
result := GetClientJsLibrary("https://test.org")
fmt.Println("Hello, world.")
fmt.Println(result)
}
func test() {
fmt.Println("Test function")
func GetClientJsLibrary(iframeUrl string) string {
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