Skip to content

Instantly share code, notes, and snippets.

@jiyuujin
Created May 3, 2020 05:13
Show Gist options
  • Save jiyuujin/6db02078a7f55f82c522784d6661aa8e to your computer and use it in GitHub Desktop.
Save jiyuujin/6db02078a7f55f82c522784d6661aa8e to your computer and use it in GitHub Desktop.
AWS LambdaでWebフォントを利用するため、S3経由でそのファイルをアップロードする
function setFontConfig() {
return new Promise((resolve, reject) => {
process.env.HOME = process.env.LAMBDA_TASK_ROOT
const command = `fc-cache -v ${process.env.HOME}fonts`
exec(command, (error, stdout, stderr) => {
if (error) {
return reject(error)
}
resolve();
})
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment