Commits

Don Brown committed 60829e6

Easier dev support

  • Participants
  • Parent commits 166659c

Comments (0)

Files changed (4)

 <div>
-    <h2>Admin content</h2>
+    <h2>Admin content<%=nameSuffix%></h2>
 </div>
 <div>    
-<h1>Apps content</h1>
+<h1>Apps content<%=nameSuffix%></h1>
 </div>

views/register.ejs

-<remote-app key="<%=appKey%>" name="<%=appName%>" version="1" icon-url="http://heroku.com/favicon.ico"
+<remote-app key="heroku-atlassian-app<%=idSuffix%>" name="Heroku Integration<%=nameSuffix%>" version="1" icon-url="http://heroku.com/favicon.ico"
             display-url="<%=displayUrl%>">
     <vendor name="Atlassian" url="http://atlassian.com" />
     <description>
     <!--permissions>
     </permissions-->
 
-    <entity-type key="app" name="App" pluralized-name="Apps" icon-url="http://heroku.com/favicon.ico"/>
+    <entity-type key="app<%=idSuffix%>" name="App<%=nameSuffix%>" pluralized-name="Apps<%=nameSuffix%>" icon-url="http://heroku.com/favicon.ico"/>
 
-    <admin-page key="herokuAdmin" name="Heroku" url="/admin" />
+    <admin-page key="herokuAdmin<%=idSuffix%>" name="Heroku<%=nameSuffix%>" url="/admin" />
 
-    <general-page key="herokuApps" name="Heroku Apps" url="/apps"/>
+    <general-page key="herokuApps<%=idSuffix%>" name="Heroku Apps<%=nameSuffix%>" url="/apps"/>
 
 </remote-app>
         express.session({ secret: process.env.SESSION_SECRET || 'mysecret'})
         );
 
-var appKey = process.env.APP_KEY || 'heroku-atlassian-app';
-var appName = process.env.APP_NAME || 'Heroku Integration';
+var isDev = process.env.NODE_ENV != "production";
+var nameSuffix = isDev ? ' (dev)' : '';
+var idSuffix = isDev ? '-dev' : '';
 var displayUrl = process.env.DISPLAY_URL || 'http://localhost:5000';
 var baseUrl = "https://remoteapps.jira.com";
 app.get('/', function(request, response) {
     response.contentType('text/xml');
     response.render('register.ejs', {
         displayUrl : displayUrl,
-        appKey : appKey,
-        appName : appName,
+        idSuffix : idSuffix,
+        nameSuffix : nameSuffix,
         layout : false
         });
   });
 app.get('/admin', function(request, response) {
     response.render('admin.ejs', {
         baseUrl : baseUrl,
+        nameSuffix : nameSuffix,
         });
   });
 app.get('/apps', function(request, response) {
     response.render('apps.ejs', {
         baseUrl : baseUrl,
+        nameSuffix : nameSuffix,
         });
     });