Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jasonmccallister/go-https-demo
Example project on implementing a Go web application using HTTPS
https://github.com/jasonmccallister/go-https-demo
demo go https webapp
Last synced: 27 days ago
JSON representation
Example project on implementing a Go web application using HTTPS
- Host: GitHub
- URL: https://github.com/jasonmccallister/go-https-demo
- Owner: jasonmccallister
- License: mit
- Created: 2017-08-08T12:29:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-30T00:55:14.000Z (about 7 years ago)
- Last Synced: 2023-08-10T14:13:56.839Z (about 1 year ago)
- Topics: demo, go, https, webapp
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go HTTPS Demo
[![Build Status](https://travis-ci.org/themccallister/go-https-demo.svg?branch=master)](https://travis-ci.org/themccallister/go-https-demo)
This is a quick demo project on generating a local certificate and spinning up a HTTPS server in Go.
## Generating a Certificate
1. Run `make csr` to generate the Certificate Signing Request (CSR)
2. Run `make cert` and fill in the prompted information to generate the certificate for the server## Building and Running the Application
1. `make run` will build the project and run the application
> Note: You might be denied permissions from running as the default/fallback port is 443 which will require sudo permissions.
### Environment Variables
The application checks for the following environment variables, if not found, it falls back to a default.
1. `APP_PORT` the port for the web server to listen on
2. `APP_CERT_FILE` the path to the certificate file for HTTPS
3. `APP_KEY_FILE` the path to the key file for HTTPS