From 0031791dbe197f5371ddb52563079cee8416105e Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Fri, 30 May 2025 05:24:16 +0200 Subject: [PATCH] Update tls example --- README.md | 3 +++ examples/tls/main.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index e6497fb..27ab3e7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Tests](https://github.com/jkaninda/okapi/actions/workflows/tests.yml/badge.svg)](https://github.com/jkaninda/okapi/actions/workflows/tests.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/jkaninda/okapi)](https://goreportcard.com/report/github.com/jkaninda/okapi) +[![Go](https://img.shields.io/github/go-mod/go-version/jkaninda/okapi)](https://go.dev/) [![Go Reference](https://pkg.go.dev/badge/github.com/jkaninda/okapi.svg)](https://pkg.go.dev/github.com/jkaninda/okapi) [![GitHub Release](https://img.shields.io/github/v/release/jkaninda/okapi)](https://github.com/jkaninda/okapi/releases) @@ -319,6 +320,8 @@ o.Static("/static", "public/assets") // Create a new Okapi instance with default config // Configured to listen on port 8080 for HTTP connections o := okapi.Default(okapi.WithAddr(":8080")) + // Use HTTPS + // o := okapi.Default(okapi.WithTls(tls)) // Configure a secondary HTTPS server listening on port 8443 // This creates both HTTP (8080) and HTTPS (8443) endpoints diff --git a/examples/tls/main.go b/examples/tls/main.go index a4a1832..b5fa719 100644 --- a/examples/tls/main.go +++ b/examples/tls/main.go @@ -42,6 +42,8 @@ func main() { // Create a new Okapi instance with default config // Configured to listen on port 8080 for HTTP connections o := okapi.Default(okapi.WithAddr(":8080")) + // Use HTTPS + // o := okapi.Default(okapi.WithTls(tls)) // Configure a secondary HTTPS server listening on port 8443 // This creates both HTTP (8080) and HTTPS (8443) endpoints