Compare commits
2 commits
dependabot
...
main
Author | SHA1 | Date | |
---|---|---|---|
4b12982597 | |||
292a5bdb0c |
4 changed files with 28 additions and 4 deletions
8
.changeset/pretty-pink-panda.md
Normal file
8
.changeset/pretty-pink-panda.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
#changelog
|
||||
---
|
||||
"apps": minor
|
||||
---
|
||||
### Added
|
||||
|
||||
- `apps/emails-and-messages/.env.template`: Described the new environment variable and how it works
|
||||
- `apps/emails-and-messages/src/saleor-app.ts`: Added case "redis" for switch(AplType), which takes advantage of the [RedisAPL PR](https://github.com/saleor/app-sdk/pull/287) I submitted
|
|
@ -7,6 +7,12 @@ APL=
|
|||
REST_APL_ENDPOINT=
|
||||
REST_APL_TOKEN=
|
||||
|
||||
# To use Redis as an APL store, set APP_API_BASE_URL and REDIS_URL.
|
||||
# URL is in format redis[s]://[[username][:password]@][host][:port][/db-number],
|
||||
# so for example redis://alice:foobared@awesome.redis.server:6380
|
||||
# For saleor-platform, thats: `redis://redis:6379/1`
|
||||
REDIS_URL=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
|
@ -15,4 +21,5 @@ APP_LOG_LEVEL=info
|
|||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
# https://docs.saleor.io/docs/3.x/developer/extending/apps/local-app-development
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
||||
APP_API_BASE_URL=
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { APL, FileAPL, SaleorCloudAPL, UpstashAPL } from "@saleor/app-sdk/APL";
|
||||
import { APL, FileAPL, RedisAPL, SaleorCloudAPL, UpstashAPL } from "@saleor/app-sdk/APL";
|
||||
import { SaleorApp } from "@saleor/app-sdk/saleor-app";
|
||||
|
||||
const aplType = process.env.APL ?? "file";
|
||||
|
@ -6,6 +6,12 @@ const aplType = process.env.APL ?? "file";
|
|||
export let apl: APL;
|
||||
|
||||
switch (aplType) {
|
||||
case "redis": {
|
||||
if (!process.env.REDIS_URL) throw new Error("Missing redis url");
|
||||
if (!process.env.APP_API_BASE_URL)
|
||||
throw new Error("Redis relies on APP_API_BASE_URL to store keys, please set env variable");
|
||||
apl = new RedisAPL(new URL(process.env.REDIS_URL), process.env.APP_API_BASE_URL);
|
||||
}
|
||||
case "upstash":
|
||||
apl = new UpstashAPL();
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
"extends": ["//"],
|
||||
"extends": [
|
||||
"//"
|
||||
],
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"pipeline": {
|
||||
"build": {
|
||||
|
@ -21,7 +23,8 @@
|
|||
"NEXT_PUBLIC_SENTRY_DSN",
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
"APP_API_BASE_URL",
|
||||
"REDIS_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue