Browse Source

Merge branch 'feat/77523-get-snippet-that-set-in-elasticsearch' into feat/create-snippet

zahmis 4 years ago
parent
commit
b34d9498c8

+ 5 - 2
packages/slackbot-proxy/src/controllers/top.ts

@@ -7,7 +7,6 @@ import { InstallerService } from '~/services/InstallerService';
 
 const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
 
-
 @Controller('/')
 export class TopCtrl {
 
@@ -22,7 +21,11 @@ export class TopCtrl {
       scopes: requiredScopes,
     });
 
-    return { url, isOfficialMode };
+    // use await import in order to avoid typescript-eslint error
+    const fs = await import('fs');
+    const growiBotVersion = JSON.parse(fs.readFileSync('../../package.json', 'utf8')).version;
+
+    return { url, isOfficialMode, growiBotVersion };
   }
 
 }

+ 3 - 0
packages/slackbot-proxy/src/views/commons/footer.ejs

@@ -0,0 +1,3 @@
+<footer>
+  <p class="text-center small">version: <%- growiBotVersion %></p>
+</footer>

+ 1 - 0
packages/slackbot-proxy/src/views/top.ejs

@@ -42,5 +42,6 @@
         </div>
       </div>
     </div>
+    <%- include('commons/footer'); %>
   </div>
 </body>