Created
August 19, 2018 18:36
-
-
Save tigransimonyan/ddf3152000d632016dc98e16ccc9f187 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get('/ru', async(request, response, next) => { | |
const videos = await Video.getIndexVideos(); | |
const response = await Promise.all(videos.map(video => { | |
return translate(video.video_title, { to: 'ru' }).then(res => { | |
return Object.assign({}, video, { video_title: res.text }); | |
}); | |
})); | |
response.render('_LANGS/rus/index', { | |
section_name: "Home", | |
videos: response | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment