diff --git a/.gitignore b/.gitignore index d862823..2c382ac 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ gin-bin *lishwist.db .env*.local -server/api/db/init_sql.go +http/api/db/init_sql.go .ignored/ diff --git a/go.work b/go.work index bd31234..72e8c6b 100644 --- a/go.work +++ b/go.work @@ -2,4 +2,4 @@ go 1.23 toolchain go1.23.3 -use ./server +use ./http diff --git a/server/api/db/db.go b/http/api/db/db.go similarity index 98% rename from server/api/db/db.go rename to http/api/db/db.go index b564228..f4fb502 100644 --- a/server/api/db/db.go +++ b/http/api/db/db.go @@ -5,7 +5,7 @@ package db import ( "database/sql" "fmt" - "lishwist/env" + "lishwist/http/env" "github.com/Teajey/sqlstore" _ "github.com/glebarez/go-sqlite" diff --git a/server/api/db/gen_init_sql.go b/http/api/db/gen_init_sql.go similarity index 100% rename from server/api/db/gen_init_sql.go rename to http/api/db/gen_init_sql.go diff --git a/server/api/db/group.go b/http/api/db/group.go similarity index 99% rename from server/api/db/group.go rename to http/api/db/group.go index b672c98..eee6785 100644 --- a/server/api/db/group.go +++ b/http/api/db/group.go @@ -2,7 +2,7 @@ package db import ( "fmt" - "lishwist/normalize" + "lishwist/http/normalize" "strconv" ) diff --git a/server/api/db/init.sql b/http/api/db/init.sql similarity index 100% rename from server/api/db/init.sql rename to http/api/db/init.sql diff --git a/server/api/db/migration/1.sql b/http/api/db/migration/1.sql similarity index 100% rename from server/api/db/migration/1.sql rename to http/api/db/migration/1.sql diff --git a/server/api/db/user.go b/http/api/db/user.go similarity index 99% rename from server/api/db/user.go rename to http/api/db/user.go index 34d2ba8..b1beb15 100644 --- a/server/api/db/user.go +++ b/http/api/db/user.go @@ -3,7 +3,7 @@ package db import ( "database/sql" "fmt" - "lishwist/normalize" + "lishwist/http/normalize" "github.com/google/uuid" ) diff --git a/server/api/login.go b/http/api/login.go similarity index 97% rename from server/api/login.go rename to http/api/login.go index d4d9341..64c12f5 100644 --- a/server/api/login.go +++ b/http/api/login.go @@ -1,8 +1,8 @@ package api import ( - "lishwist/api/db" - "lishwist/templates" + "lishwist/http/api/db" + "lishwist/http/templates" "log" "golang.org/x/crypto/bcrypt" diff --git a/server/api/register.go b/http/api/register.go similarity index 97% rename from server/api/register.go rename to http/api/register.go index 1d72fa5..1a4eca2 100644 --- a/server/api/register.go +++ b/http/api/register.go @@ -3,8 +3,8 @@ package api import ( "log" - "lishwist/api/db" - "lishwist/templates" + "lishwist/http/api/db" + "lishwist/http/templates" "golang.org/x/crypto/bcrypt" ) diff --git a/server/env/env.go b/http/env/env.go similarity index 100% rename from server/env/env.go rename to http/env/env.go diff --git a/server/go.mod b/http/go.mod similarity index 96% rename from server/go.mod rename to http/go.mod index cebcb93..ca1fb6a 100644 --- a/server/go.mod +++ b/http/go.mod @@ -1,4 +1,4 @@ -module lishwist +module lishwist/http go 1.23 diff --git a/server/go.sum b/http/go.sum similarity index 100% rename from server/go.sum rename to http/go.sum diff --git a/server/hashpword/main.go b/http/hashpword/main.go similarity index 100% rename from server/hashpword/main.go rename to http/hashpword/main.go diff --git a/server/main.go b/http/main.go similarity index 92% rename from server/main.go rename to http/main.go index d77f133..640577b 100644 --- a/server/main.go +++ b/http/main.go @@ -5,12 +5,12 @@ import ( "log" "net/http" - "lishwist/api" - // TODO: lishwist/api/db ought not to be used outside lishwist/api - "lishwist/api/db" - "lishwist/env" - "lishwist/router" - "lishwist/routing" + "lishwist/http/api" + // TODO: lishwist/http/api/db ought not to be used outside lishwist/http/api + "lishwist/http/api/db" + "lishwist/http/env" + "lishwist/http/router" + "lishwist/http/routing" ) func main() { diff --git a/server/normalize/name.go b/http/normalize/name.go similarity index 100% rename from server/normalize/name.go rename to http/normalize/name.go diff --git a/server/router/router.go b/http/router/router.go similarity index 96% rename from server/router/router.go rename to http/router/router.go index 56049d2..8891f68 100644 --- a/server/router/router.go +++ b/http/router/router.go @@ -1,7 +1,7 @@ package router import ( - "lishwist/rsvp" + "lishwist/http/rsvp" "net/http" "github.com/Teajey/sqlstore" diff --git a/server/routing/context.go b/http/routing/context.go similarity index 93% rename from server/routing/context.go rename to http/routing/context.go index 1d48290..b9ec3da 100644 --- a/server/routing/context.go +++ b/http/routing/context.go @@ -1,8 +1,8 @@ package routing import ( - "lishwist/api/db" - "lishwist/rsvp" + "lishwist/http/api/db" + "lishwist/http/rsvp" "net/http" ) diff --git a/server/routing/error.go b/http/routing/error.go similarity index 100% rename from server/routing/error.go rename to http/routing/error.go diff --git a/server/routing/foreign_wishlist.go b/http/routing/foreign_wishlist.go similarity index 97% rename from server/routing/foreign_wishlist.go rename to http/routing/foreign_wishlist.go index 0eb0123..6363661 100644 --- a/server/routing/foreign_wishlist.go +++ b/http/routing/foreign_wishlist.go @@ -1,8 +1,8 @@ package routing import ( - "lishwist/api/db" - "lishwist/rsvp" + "lishwist/http/api/db" + "lishwist/http/rsvp" "net/http" ) diff --git a/server/routing/groups.go b/http/routing/groups.go similarity index 98% rename from server/routing/groups.go rename to http/routing/groups.go index a6db5e5..89f6bb6 100644 --- a/server/routing/groups.go +++ b/http/routing/groups.go @@ -4,8 +4,8 @@ import ( "net/http" "slices" - "lishwist/api/db" - "lishwist/rsvp" + "lishwist/http/api/db" + "lishwist/http/rsvp" ) type GroupProps struct { diff --git a/server/routing/home.go b/http/routing/home.go similarity index 95% rename from server/routing/home.go rename to http/routing/home.go index 7f05b79..b8dbf54 100644 --- a/server/routing/home.go +++ b/http/routing/home.go @@ -3,9 +3,9 @@ package routing import ( "net/http" - "lishwist/api/db" - "lishwist/env" - "lishwist/rsvp" + "lishwist/http/api/db" + "lishwist/http/env" + "lishwist/http/rsvp" ) type HomeProps struct { diff --git a/server/routing/login.go b/http/routing/login.go similarity index 96% rename from server/routing/login.go rename to http/routing/login.go index dffb9b1..d5214bd 100644 --- a/server/routing/login.go +++ b/http/routing/login.go @@ -1,8 +1,8 @@ package routing import ( - "lishwist/api" - "lishwist/rsvp" + "lishwist/http/api" + "lishwist/http/rsvp" "net/http" ) diff --git a/server/routing/logout.go b/http/routing/logout.go similarity index 91% rename from server/routing/logout.go rename to http/routing/logout.go index 5b4b19f..dc1bb66 100644 --- a/server/routing/logout.go +++ b/http/routing/logout.go @@ -1,7 +1,7 @@ package routing import ( - "lishwist/rsvp" + "lishwist/http/rsvp" "net/http" ) diff --git a/server/routing/not_found.go b/http/routing/not_found.go similarity index 88% rename from server/routing/not_found.go rename to http/routing/not_found.go index 6b2ed65..43a0efd 100644 --- a/server/routing/not_found.go +++ b/http/routing/not_found.go @@ -3,7 +3,7 @@ package routing import ( "net/http" - "lishwist/rsvp" + "lishwist/http/rsvp" ) func NotFound(h http.Header, r *rsvp.Request) rsvp.Response { diff --git a/server/routing/register.go b/http/routing/register.go similarity index 95% rename from server/routing/register.go rename to http/routing/register.go index c9118b3..de68d0b 100644 --- a/server/routing/register.go +++ b/http/routing/register.go @@ -1,8 +1,8 @@ package routing import ( - "lishwist/api" - "lishwist/rsvp" + "lishwist/http/api" + "lishwist/http/rsvp" "net/http" ) diff --git a/server/routing/todo.go b/http/routing/todo.go similarity index 93% rename from server/routing/todo.go rename to http/routing/todo.go index d856a3e..8680659 100644 --- a/server/routing/todo.go +++ b/http/routing/todo.go @@ -1,8 +1,8 @@ package routing import ( - "lishwist/api/db" - "lishwist/rsvp" + "lishwist/http/api/db" + "lishwist/http/rsvp" "net/http" ) diff --git a/server/routing/users.go b/http/routing/users.go similarity index 97% rename from server/routing/users.go rename to http/routing/users.go index 826f14b..abee64f 100644 --- a/server/routing/users.go +++ b/http/routing/users.go @@ -1,8 +1,8 @@ package routing import ( - "lishwist/api/db" - "lishwist/rsvp" + "lishwist/http/api/db" + "lishwist/http/rsvp" "net/http" ) diff --git a/server/routing/wishlist.go b/http/routing/wishlist.go similarity index 97% rename from server/routing/wishlist.go rename to http/routing/wishlist.go index d8b2c4e..88b3bc2 100644 --- a/server/routing/wishlist.go +++ b/http/routing/wishlist.go @@ -1,8 +1,8 @@ package routing import ( - "lishwist/api/db" - "lishwist/rsvp" + "lishwist/http/api/db" + "lishwist/http/rsvp" "net/http" ) diff --git a/server/rsvp/handler.go b/http/rsvp/handler.go similarity index 100% rename from server/rsvp/handler.go rename to http/rsvp/handler.go diff --git a/server/rsvp/request.go b/http/rsvp/request.go similarity index 100% rename from server/rsvp/request.go rename to http/rsvp/request.go diff --git a/server/rsvp/response.go b/http/rsvp/response.go similarity index 98% rename from server/rsvp/response.go rename to http/rsvp/response.go index c72536f..1a36408 100644 --- a/server/rsvp/response.go +++ b/http/rsvp/response.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "lishwist/templates" + "lishwist/http/templates" "log" "net/http" "strings" diff --git a/server/rsvp/session.go b/http/rsvp/session.go similarity index 100% rename from server/rsvp/session.go rename to http/rsvp/session.go diff --git a/server/session/session.go b/http/session/session.go similarity index 100% rename from server/session/session.go rename to http/session/session.go diff --git a/server/templates/base.gotmpl b/http/templates/base.gotmpl similarity index 100% rename from server/templates/base.gotmpl rename to http/templates/base.gotmpl diff --git a/server/templates/error_page.gotmpl b/http/templates/error_page.gotmpl similarity index 100% rename from server/templates/error_page.gotmpl rename to http/templates/error_page.gotmpl diff --git a/server/templates/foreign_wishlist.gotmpl b/http/templates/foreign_wishlist.gotmpl similarity index 100% rename from server/templates/foreign_wishlist.gotmpl rename to http/templates/foreign_wishlist.gotmpl diff --git a/server/templates/group_page.gotmpl b/http/templates/group_page.gotmpl similarity index 100% rename from server/templates/group_page.gotmpl rename to http/templates/group_page.gotmpl diff --git a/server/templates/home.gotmpl b/http/templates/home.gotmpl similarity index 100% rename from server/templates/home.gotmpl rename to http/templates/home.gotmpl diff --git a/server/templates/login.gotmpl b/http/templates/login.gotmpl similarity index 100% rename from server/templates/login.gotmpl rename to http/templates/login.gotmpl diff --git a/server/templates/public_foreign_wishlist.gotmpl b/http/templates/public_foreign_wishlist.gotmpl similarity index 100% rename from server/templates/public_foreign_wishlist.gotmpl rename to http/templates/public_foreign_wishlist.gotmpl diff --git a/server/templates/public_group_page.gotmpl b/http/templates/public_group_page.gotmpl similarity index 100% rename from server/templates/public_group_page.gotmpl rename to http/templates/public_group_page.gotmpl diff --git a/server/templates/register.gotmpl b/http/templates/register.gotmpl similarity index 100% rename from server/templates/register.gotmpl rename to http/templates/register.gotmpl diff --git a/server/templates/templates.go b/http/templates/templates.go similarity index 100% rename from server/templates/templates.go rename to http/templates/templates.go