diff --git a/backend/src/lumina/web/routing/api_fe.gleam b/backend/src/lumina/web/routing/api_fe.gleam index c3222e2..af0fcb8 100644 --- a/backend/src/lumina/web/routing/api_fe.gleam +++ b/backend/src/lumina/web/routing/api_fe.gleam @@ -14,6 +14,10 @@ import gleam/string import gleam/string_builder import lumina/data/context.{type Context} import lumina/shared/shared_fejsonobject +import lumina/shared/shared_fepage_com.{ + type FEPageServeRequest, type FEPageServeResponse, FEPageServeRequest, + FEPageServeResponse, +} import lumina/shared/shared_users import lumina/users import lumina/web/pages @@ -224,14 +228,6 @@ pub fn create_user(req: wisp.Request, ctx: context.Context) { } } -type FEPageServeRequest { - FEPageServeRequest(location: String) -} - -type FEPageServeResponse { - FEPageServeResponse(main: String, side: String, message: List(Int)) -} - pub fn pagesrverresponder(req: wisp.Request, ctx: context.Context) { let pagesrverresponseencoder = fn(response: FEPageServeResponse) { json.object([ diff --git a/shared/src/lumina/shared/shared_fepage_com.gleam b/shared/src/lumina/shared/shared_fepage_com.gleam new file mode 100644 index 0000000..baaaab8 --- /dev/null +++ b/shared/src/lumina/shared/shared_fepage_com.gleam @@ -0,0 +1,12 @@ +// Copyright (c) 2024, MLC 'Strawmelonjuice' Bloeiman +// Licensed under the BSD 3-Clause License. See the LICENSE file for more info. + +/// A request from the client to the server to serve a page. +pub type FEPageServeRequest { + FEPageServeRequest(location: String) +} + +/// A response from the server to a request to serve a page. +pub type FEPageServeResponse { + FEPageServeResponse(main: String, side: String, message: List(Int)) +}