Skip to content

Instantly share code, notes, and snippets.

View crhntr's full-sized avatar

Christopher Hunter crhntr

View GitHub Profile
@crhntr
crhntr / main.go
Last active August 13, 2020 09:00 — forked from philippta/main.go
Clean Go API example with access policies
// I saw this in a reddit post. I thought I would refactor it using a functional pattern.
// I don't think my refactor makes sense after noticing that this pattern is what chi suggests.
package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
worker_processes 1;
user nobody nogroup;
# 'user nobody nobody;' for systems with 'nobody' as a group instead
pid /run/nginx.pid;
# error_log /tmp/nginx.error.log;
events {
worker_connections 1024; # increase if you have lots of clients
accept_mutex off; # set to 'on' if nginx worker_processes > 1