diff options
Diffstat (limited to 'app/Controllers/Http')
-rw-r--r-- | app/Controllers/Http/StaticController.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/Controllers/Http/StaticController.js b/app/Controllers/Http/StaticController.js index b16e6cb..7041e83 100644 --- a/app/Controllers/Http/StaticController.js +++ b/app/Controllers/Http/StaticController.js | |||
@@ -2,6 +2,9 @@ | |||
2 | /** | 2 | /** |
3 | * Controller for routes with static responses | 3 | * Controller for routes with static responses |
4 | */ | 4 | */ |
5 | const Helpers = use('Helpers'); | ||
6 | const fs = require('fs-extra'); | ||
7 | const path = require('path'); | ||
5 | 8 | ||
6 | class StaticController { | 9 | class StaticController { |
7 | // Enable all features | 10 | // Enable all features |
@@ -214,9 +217,15 @@ class StaticController { | |||
214 | } | 217 | } |
215 | 218 | ||
216 | // Show announcements | 219 | // Show announcements |
217 | announcement({ | 220 | async announcement({ |
218 | response, | 221 | response, |
222 | params, | ||
219 | }) { | 223 | }) { |
224 | const announcement = path.join(Helpers.resourcesPath(), 'announcements', `${params.version}.json`); | ||
225 | |||
226 | if (await fs.pathExists(announcement)) { | ||
227 | return response.download(announcement); | ||
228 | } | ||
220 | return response.send('No announcement found.'); | 229 | return response.send('No announcement found.'); |
221 | } | 230 | } |
222 | } | 231 | } |