Server to allow uploading and serving of signatures.
- Node
npm start
There are a few environment variables you can set to modify the server's behavior:
SIGNATURE_PATH
- where to store the signature files. if not set, will default to./public/signatures
PORT
- configure the listening port. if not set, defaults to8080
If you want to enable TLS, set the following two variables. Failure to set both will result in TLS being disabled. For more information you can read this.
CERT_PATH
- path of the cert, eg)server.crt
KEY_PATH
- path of the key, eg)server.key
npm test
# start server
npm start
# generate binary file, binary.dat
i=0; while [ $i -lt 256 ]; do echo -en '\x'$(printf "%0x" $i)'' >> binary.dat; i=$((i+1)); done\n
# curl server, uploading binary.dat
curl --header "Data-Filename: file.dat" --header "Content-Type:application/octet-stream" --location --request POST "http://127.0.0.1:8080/upload" --data-binary "@./binary.dat"
# verify upload was successful
cat ./public/signatures/file.dat
# verify through browser or curl endpoint
curl http://localhost:8080/signatures