Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Needham Circle functions

The invocation-based Cloud Run functions behind
[Needham Circle](https://github.com/needham-circle/needham-circle):
The invocation-based Cloud Run functions behind https://needhamcircle.org.
the static site calls these from the browser for everything dynamic. Each
endpoint is its own deployed function; they all share this Go module and are
selected at deploy time with `--entry-point`.
Expand All @@ -23,10 +22,7 @@ selected at deploy time with `--entry-point`.
- All three answer CORS preflights and stamp CORS headers. The allowlist is
baked in, nothing to configure: deployed (Cloud Run sets `K_SERVICE`) the
functions accept https://needhamcircle.org (and www); running locally they
accept the local Jekyll site (localhost:4000). Browsers on any other
origin — including needham-circle.github.io — can't call them, so the
site must be served from the custom domain (or locally) for the dynamic
pages to work.
accept the local Jekyll site (localhost:4000).
- `SendContact` also honors `SMTP_ACCOUNT` (default `needhamcircle@gmail.com`).

## Layout
Expand Down
2 changes: 1 addition & 1 deletion cmd/devserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"net/http"
"os"

"github.com/needham-circle/functions"
"github.com/needhamcircle/functions"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions cors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestApplyCORSEchoesAllowedOrigins(t *testing.T) {
origins := []string{"https://needham-circle.github.io", "http://localhost:4000"}
origins := []string{"https://needhamcircle.github.io", "http://localhost:4000"}

rec := httptest.NewRecorder()
request := httptest.NewRequest(http.MethodGet, "/", nil)
Expand All @@ -29,7 +29,7 @@ func TestApplyCORSIgnoresUnlistedOrigins(t *testing.T) {
request := httptest.NewRequest(http.MethodGet, "/", nil)
request.Header.Set("Origin", "https://evil.example")

applyCORS([]string{"https://needham-circle.github.io"}, rec, request)
applyCORS([]string{"https://needhamcircle.github.io"}, rec, request)

if got := rec.Header().Get("Access-Control-Allow-Origin"); got != "" {
t.Errorf("Allow-Origin = %q, want none for an unlisted origin", got)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/needham-circle/functions
module github.com/needhamcircle/functions

go 1.25.0

Expand Down