diff --git a/build.sh b/build.sh index 9dbfffd..6d8799b 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,6 @@ MYDIR=`pwd`; cd src; # Build echo "Building..." -export RELEASE_MODE=1; -CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ../dist/freepad . +GIN_MODE=release CGO_ENABLED=0 GOOS=linux GIN_MODE=release go build -a -installsuffix cgo -o ../dist/freepad . # Go back! cd $MYDIR; \ No newline at end of file diff --git a/dist/freepad b/dist/freepad index 5682a80..7124947 100755 Binary files a/dist/freepad and b/dist/freepad differ diff --git a/dist/static/js/main.js b/dist/static/js/main.js index 1b3c9d0..0e6aec1 100644 --- a/dist/static/js/main.js +++ b/dist/static/js/main.js @@ -80,3 +80,27 @@ function goToPost() { } } } + +function getQr(link = `https://justkato.me/`) { + return new Promise((_r, _e) => { + let formData = new FormData(); + formData.append('link', link); + + // Send out a fetch request + fetch("/api/qr", { + method: "post", + body: formData, + }) + .then( result => { + result.json() + .then( rez => { + return _r(rez); + }) + }) + .catch( error => { + console.error(error); + alert(error); + return _e(error); + }) + }) +} \ No newline at end of file diff --git a/dist/templates/pages/page.html b/dist/templates/pages/page.html index 49b0742..a721ab3 100644 --- a/dist/templates/pages/page.html +++ b/dist/templates/pages/page.html @@ -1,9 +1,16 @@ {{ template "inc/header.html" .}} + +