Skip to content

Commit 9eed4c4

Browse files
Minor fixes
1 parent d307f46 commit 9eed4c4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ const app = express()
1919

2020
app.use(cors())
2121
app.use(fileUpload({
22-
limits: { fileSize: config.FILE_UPLOAD_SIZE_LIMIT }
22+
limits: { fileSize: config.FILE_UPLOAD_SIZE_LIMIT },
23+
useTempFiles : true,
24+
tempFileDir : config.FILE_UPLOAD_TEMP_DIR
2325
}))
2426
app.use(bodyParser.json())
2527
app.use(bodyParser.urlencoded({ extended: true }))

config/default.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ module.exports = {
2222
AWS_REGION: process.env.AWS_REGION || 'ap-northeast-1',
2323
IS_LOCAL_DB: process.env.IS_LOCAL_DB ? process.env.IS_LOCAL_DB === 'true' : true,
2424
DYNAMODB_URL: process.env.DYNAMODB_URL || 'http://localhost:7777',
25-
ATTACHMENT_S3_BUCKET: process.env.ATTACHMENT_S3_BUCKET || 'my-testing-bucket-12345'
25+
ATTACHMENT_S3_BUCKET: process.env.ATTACHMENT_S3_BUCKET || 'my-testing-bucket-12345',
26+
S3_API_VERSION: process.env.S3_API_VERSION || '2006-03-01'
2627
},
2728
// in bytes
2829
FILE_UPLOAD_SIZE_LIMIT: process.env.FILE_UPLOAD_SIZE_LIMIT
2930
? Number(process.env.FILE_UPLOAD_SIZE_LIMIT) : 50 * 1024 * 1024, // 50M
31+
FILE_UPLOAD_TEMP_DIR: process.env.FILE_UPLOAD_TEMP_DIR || '/tmp/',
3032
CHALLENGES_API_URL: process.env.CHALLENGES_API_URL || 'http://localhost:4000/v5/challenges',
3133
GROUPS_API_URL: process.env.GROUPS_API_URL || 'http://localhost:4000/v5/groups',
3234
// copilot resource role ids allowed to upload attachment

src/common/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const m2m = m2mAuth(_.pick(config, ['AUTH0_URL', 'AUTH0_AUDIENCE', 'TOKEN_CACHE_
1414
const axios = require('axios')
1515

1616
AWS.config.update({
17-
s3: '2006-03-01', // S3 API version
17+
s3: config.AMAZON.S3_API_VERSION,
1818
accessKeyId: config.AMAZON.AWS_ACCESS_KEY_ID,
1919
secretAccessKey: config.AMAZON.AWS_SECRET_ACCESS_KEY,
2020
region: config.AMAZON.AWS_REGION

0 commit comments

Comments
 (0)