-
Notifications
You must be signed in to change notification settings - Fork 4
/
medusa-config-admin.js
91 lines (84 loc) · 2.33 KB
/
medusa-config-admin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// CORS when consuming Medusa from admin
const ADMIN_CORS =
process.env.ADMIN_CORS || "http://localhost:7000,http://localhost:7001";
// CORS to avoid issues when consuming Medusa from a client
const STORE_CORS = process.env.STORE_CORS || "http://localhost:8000";
const DATABASE_URL =
process.env.DATABASE_URL || "postgres://localhost/medusa-starter-default";
const REDIS_URL = process.env.REDIS_URL || "redis://cache:6379";
const plugins = [
`medusa-fulfillment-manual`,
`medusa-payment-manual`,
{
resolve: `medusa-plugin-file-cloud-storage`,
options: {
credentials : {
client_email: process.env.GCS_CLIENT_EMAIL,
private_key: process.env.GCS_SA_PRIVATE_KEY.split(String.raw`\n`).join('\n')
},
publicBucketName: process.env.GCS_PUBLIC_BUCKET_NAME,
basePublicUrl: process.env.GCS_BASE_PUBLIC_URL,
},
},
{
resolve: "@medusajs/admin",
/** @type {import('@medusajs/admin').PluginOptions} */
options: {
serve: true,
path: "/adminapp",
autoRebuild: false,
},
},
{
resolve: `medusa-payment-stripe`,
options: {
api_key: process.env.STRIPE_SECRET_KEY
},
},
{
resolve: `medusa-plugin-sendgrid`,
options: {
api_key: process.env.SENDGRID_API_KEY,
from: process.env.SENDGRID_FROM,
order_placed_template: process.env.SENDGRID_ORDER_PLACED_ID,
},
},
{
resolve: `medusa-file-minio`,
options: {
endpoint: process.env.MINIO_ENDPOINT,
private_bucket: process.env.MINIO_PRIVATE_BUCKET,
private_access_key_id: process.env.MINIO_PRIVATE_ACCESS_KEY,
private_secret_access_key: process.env.MINIO_PRIVATE_SECRET_KEY,
},
},
];
const modules = {
eventBus: {
resolve: "@medusajs/event-bus-redis",
options: {
redisUrl: REDIS_URL
}
},
cacheService: {
resolve: "@medusajs/cache-redis",
options: {
redisUrl: REDIS_URL
}
},
};
/** @type {import('@medusajs/medusa').ConfigModule["projectConfig"]} */
const projectConfig = {
jwt_secret: process.env.JWT_SECRET || "supersecret",
cookie_secret: process.env.COOKIE_SECRET || "supersecret",
store_cors: STORE_CORS,
database_url: DATABASE_URL,
admin_cors: ADMIN_CORS,
redis_url: REDIS_URL
};
/** @type {import('@medusajs/medusa').ConfigModule} */
module.exports = {
projectConfig,
plugins,
modules,
};