-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
62 lines (56 loc) · 2.42 KB
/
config.ts
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
import { S3Config } from '@k6-contrib/fields-s3';
import { S3ImagesConfig } from '@k6-contrib/fields-s3-images';
export let s3ImagesConfig: S3ImagesConfig;
export let s3Config: S3Config;
import 'dotenv/config';
if (process.env.S3_BUCKET) {
s3ImagesConfig = {
bucket: process.env.S3_BUCKET, // name of bucket
folder: process.env.S3_PATH,
baseUrl: process.env.S3_BASE_URL, // if provided the url is not compouted from endpoint and folder, rather use this as `${baseUrl}/${filename}`
s3Options: {
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
region: process.env.REGION, // use region for aws, endpoint for s3 compatible storage
},
sizes: {
sm: 360,
md: 720,
lg: 1280,
// optional
// if specified, a base64 data url will be generated from an image resized to this number of pixels
// see: https://nextjs.org/docs/api-reference/next/image#blurdataurl for potential uses
base64: 10,
},
uploadParams() {
return {
ACL: 'public-read', // needed to make it public
};
},
};
s3Config = {
bucket: process.env.S3_BUCKET, // name of bucket
folder: process.env.S3_PATH,
baseUrl: process.env.S3_BASE_URL, // if provided the url is not compouted from endpoint and folder, rather use this as `${baseUrl}/${filename}`
s3Options: {
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
region: process.env.REGION, // use region for aws, endpoint for s3 compatible storage
},
uploadParams() {
return {
ACL: 'public-read', // needed to make it public
};
},
};
}
// 3000 is standard for node apps
// Once deployed, Railway will supply this var to your app
export const PORT = parseInt(process.env.PORT) || 3000;
// Postgres DB URL
// The default value here will work if you've installed Postgres on MacOS using brew
// One the app is deployed to Railway, this var will be supplied by the Postgres plugin
export const DATABASE_URL =
process.env.DATABASE_URL || `postgres://${process.env.USER}@localhost/keystone-6-example`;
// Default to 30 days
export const SESSION_MAX_AGE = parseInt(process.env.SESSION_MAX_AGE) || 60 * 60 * 24 * 30;