diff --git a/examples/online-boutique/services/ad/ad.go b/examples/online-boutique/services/ad/ad.go index 8108953864..a9ca57526e 100644 --- a/examples/online-boutique/services/ad/ad.go +++ b/examples/online-boutique/services/ad/ad.go @@ -33,6 +33,7 @@ type AdResponse struct { } //ftl:verb +//ftl:ingress GET /ad func Get(ctx context.Context, req AdRequest) (AdResponse, error) { resp := AdResponse{} if len(req.ContextKeys) > 0 { diff --git a/examples/online-boutique/services/cart/cart.go b/examples/online-boutique/services/cart/cart.go index 61715a7bbd..f13675a017 100644 --- a/examples/online-boutique/services/cart/cart.go +++ b/examples/online-boutique/services/cart/cart.go @@ -25,6 +25,7 @@ type Cart struct { } //ftl:verb +//ftl:ingress POST /cart/add func AddItem(ctx context.Context, req AddItemRequest) (AddItemResponse, error) { store.Add(req.UserID, req.Item) return AddItemResponse{}, nil @@ -35,6 +36,7 @@ type GetCartRequest struct { } //ftl:verb +//ftl:ingress GET /cart func GetCart(ctx context.Context, req GetCartRequest) (Cart, error) { return Cart{Items: store.Get(req.UserID)}, nil } @@ -46,6 +48,7 @@ type EmptyCartRequest struct { type EmptyCartResponse struct{} //ftl:verb +//ftl:ingress POST /cart/empty func EmptyCart(ctx context.Context, req EmptyCartRequest) (EmptyCartResponse, error) { store.Empty(req.UserID) return EmptyCartResponse{}, nil diff --git a/examples/online-boutique/services/checkout/checkout.go b/examples/online-boutique/services/checkout/checkout.go index 1fb01a4ce8..85f5a011e5 100644 --- a/examples/online-boutique/services/checkout/checkout.go +++ b/examples/online-boutique/services/checkout/checkout.go @@ -40,6 +40,7 @@ type Order struct { } //ftl:verb +//ftl:ingress POST /checkout func PlaceOrder(ctx context.Context, req PlaceOrderRequest) (Order, error) { cartItems, err := ftl.Call(ctx, cart.GetCart, cart.GetCartRequest{UserID: req.UserID}) if err != nil { diff --git a/examples/online-boutique/services/currency/currency.go b/examples/online-boutique/services/currency/currency.go index 6d99557ee2..cf0d977513 100644 --- a/examples/online-boutique/services/currency/currency.go +++ b/examples/online-boutique/services/currency/currency.go @@ -27,6 +27,7 @@ type GetSupportedCurrenciesResponse struct { } //ftl:verb +//ftl:ingress GET /currency/supported func GetSupportedCurrencies(ctx context.Context, req GetSupportedCurrenciesRequest) (GetSupportedCurrenciesResponse, error) { return GetSupportedCurrenciesResponse{CurrencyCodes: maps.Keys(database)}, nil } @@ -37,6 +38,7 @@ type ConvertRequest struct { } //ftl:verb +//ftl:ingress POST /currency/convert func Convert(ctx context.Context, req ConvertRequest) (money.Money, error) { from := req.From fromRate, ok := database[from.CurrencyCode] diff --git a/examples/online-boutique/services/payment/payment.go b/examples/online-boutique/services/payment/payment.go index b46fba3d53..adc54bcb56 100644 --- a/examples/online-boutique/services/payment/payment.go +++ b/examples/online-boutique/services/payment/payment.go @@ -52,6 +52,7 @@ type ChargeResponse struct { } //ftl:verb +//ftl:ingress POST /payment/charge func Charge(ctx context.Context, req ChargeRequest) (ChargeResponse, error) { card := req.CreditCard number := strings.ReplaceAll(card.Number, "-", "") diff --git a/examples/online-boutique/services/productcatalog/database.json b/examples/online-boutique/services/productcatalog/database.json index f229ecf9fa..596f601375 100644 --- a/examples/online-boutique/services/productcatalog/database.json +++ b/examples/online-boutique/services/productcatalog/database.json @@ -3,7 +3,7 @@ "id": "OLJCESPC7Z", "name": "Sunglasses", "description": "Add a modern touch to your outfits with these sleek aviator sunglasses.", - "picture": "/static/img/products/sunglasses.jpg", + "picture": "https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/src/frontend/static/img/products/sunglasses.jpg?raw=true", "priceUsd": { "currencyCode": "USD", "units": 19, @@ -15,7 +15,7 @@ "id": "66VCHSJNUP", "name": "Tank Top", "description": "Perfectly cropped cotton tank, with a scooped neckline.", - "picture": "/static/img/products/tank-top.jpg", + "picture": "https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/src/frontend/static/img/products/tank-top.jpg?raw=true", "priceUsd": { "currencyCode": "USD", "units": 18, @@ -27,7 +27,7 @@ "id": "1YMWWN1N4O", "name": "Watch", "description": "This gold-tone stainless steel watch will work with most of your outfits.", - "picture": "/static/img/products/watch.jpg", + "picture": "https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/src/frontend/static/img/products/watch.jpg?raw=true", "priceUsd": { "currencyCode": "USD", "units": 109, @@ -39,7 +39,7 @@ "id": "L9ECAV7KIM", "name": "Loafers", "description": "A neat addition to your summer wardrobe.", - "picture": "/static/img/products/loafers.jpg", + "picture": "https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/src/frontend/static/img/products/loafers.jpg?raw=true", "priceUsd": { "currencyCode": "USD", "units": 89, @@ -51,7 +51,7 @@ "id": "2ZYFJ3GM2N", "name": "Hairdryer", "description": "This lightweight hairdryer has 3 heat and speed settings. It's perfect for travel.", - "picture": "/static/img/products/hairdryer.jpg", + "picture": "https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/src/frontend/static/img/products/hairdryer.jpg?raw=true", "priceUsd": { "currencyCode": "USD", "units": 24, @@ -63,7 +63,7 @@ "id": "0PUK6V6EV0", "name": "Candle Holder", "description": "This small but intricate candle holder is an excellent gift.", - "picture": "/static/img/products/candle-holder.jpg", + "picture": "https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/src/frontend/static/img/products/candle-holder.jpg?raw=true", "priceUsd": { "currencyCode": "USD", "units": 18, @@ -75,7 +75,7 @@ "id": "LS4PSXUNUM", "name": "Salt & Pepper Shakers", "description": "Add some flavor to your kitchen.", - "picture": "/static/img/products/salt-and-pepper-shakers.jpg", + "picture": "https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/src/frontend/static/img/products/salt-and-pepper-shakers.jpg?raw=true", "priceUsd": { "currencyCode": "USD", "units": 18, @@ -87,7 +87,7 @@ "id": "9SIQT8TOJO", "name": "Bamboo Glass Jar", "description": "This bamboo glass jar can hold 57 oz (1.7 l) and is perfect for any kitchen.", - "picture": "/static/img/products/bamboo-glass-jar.jpg", + "picture": "https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/main/src/frontend/static/img/products/bamboo-glass-jar.jpg", "priceUsd": { "currencyCode": "USD", "units": 5, @@ -99,7 +99,7 @@ "id": "6E92ZMYYFZ", "name": "Mug", "description": "A simple mug with a mustard interior.", - "picture": "/static/img/products/mug.jpg", + "picture": "https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/src/frontend/static/img/products/mug.jpg?raw=true", "priceUsd": { "currencyCode": "USD", "units": 8, @@ -107,4 +107,4 @@ }, "categories": ["kitchen"] } -] \ No newline at end of file +] diff --git a/examples/online-boutique/services/productcatalog/productcatalog.go b/examples/online-boutique/services/productcatalog/productcatalog.go index 8b310087e4..cdb0fba175 100644 --- a/examples/online-boutique/services/productcatalog/productcatalog.go +++ b/examples/online-boutique/services/productcatalog/productcatalog.go @@ -37,6 +37,7 @@ type ListResponse struct { } //ftl:verb +//ftl:ingress GET /productcatalog func List(ctx context.Context, req ListRequest) (ListResponse, error) { return ListResponse{Products: database}, nil } @@ -46,6 +47,7 @@ type GetRequest struct { } //ftl:verb +//ftl:ingress GET /productcatalog/id func Get(ctx context.Context, req GetRequest) (Product, error) { for _, p := range database { if p.ID == req.ID { diff --git a/examples/online-boutique/services/recommendation/recommendation.go b/examples/online-boutique/services/recommendation/recommendation.go index f6a2aad872..b23a8ada9c 100644 --- a/examples/online-boutique/services/recommendation/recommendation.go +++ b/examples/online-boutique/services/recommendation/recommendation.go @@ -21,6 +21,7 @@ type ListResponse struct { } //ftl:verb +//ftl:ingress GET /recommendation func List(ctx context.Context, req ListRequest) (ListResponse, error) { catalog, err := ftl.Call(ctx, productcatalog.List, productcatalog.ListRequest{}) diff --git a/examples/online-boutique/services/shipping/shipping.go b/examples/online-boutique/services/shipping/shipping.go index 2ecf6e57ad..25412cdc66 100644 --- a/examples/online-boutique/services/shipping/shipping.go +++ b/examples/online-boutique/services/shipping/shipping.go @@ -24,6 +24,7 @@ type ShippingRequest struct { } //ftl:verb +//ftl:ingress POST /shipping/quote func GetQuote(ctx context.Context, req ShippingRequest) (money.Money, error) { return moneyFromUSD(8.99), nil } @@ -33,6 +34,7 @@ type ShipOrderResponse struct { } //ftl:verb +//ftl:ingress POST /shipping/ship func ShipOrder(ctx context.Context, req ShippingRequest) (ShipOrderResponse, error) { baseAddress := fmt.Sprintf("%s, %s, %s", req.Address.StreetAddress, req.Address.City, req.Address.State) return ShipOrderResponse{ID: createTrackingID(baseAddress)}, nil