spa-server

command module
v0.0.0-...-b84c151 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 15 Imported by: 0

README

Single Page App Server

Minimal server for serving a single-page app

Build

Pointing to the root directory, run:

make

The compiled executable can be found in the build/ directory. Then, to run it:

./build/serve

Deployment

Build for target platform

You can pass in environment variables to compile for a different platform. For example, on a Linux x86 (AWS typically) box:

env GOOS=linux GOARCH=386 make
Copy to target
scp -i path/to/downloaded/ec2/pem path/to/build/serve ec2-user@ec2-ip-addr.compute-1.amazonaws.com:/home/ec2-user/targetdirectory
SSL

This executable integrates simplecert, so certificate generation is automatic. If the -ssl option is enabled, then run:

sudo ./serve -port 443 -rootdir my_app -ssl -domain mysite.com -sslemail email@domain.com -certcache /etc/letsencrypt/live/mysite.com

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL