Commits

Don Brown committed 166659c

Made more flexible to support dev and prod

Comments (0)

Files changed (3)

public/atlassian-remote-app.xml

-<remote-app key="heroku-atlassian-app" name="Heroku Remote App" version="1" icon-url="http://heroku.com/favicon.ico"
-            display-url="http://heroku-atlassian-app.herokuapps.com">
-    <vendor name="Atlassian" url="http://atlassian.com" />
-    <description>
-        Heroku integration for associating JIRA projects with Heroku apps
-    </description>
-
-    <!--permissions>
-    </permissions-->
-
-    <entity-type key="app" name="App" pluralized-name="Apps" icon-url="http://heroku.com/favicon.ico"/>
-
-    <admin-page key="herokuAdmin" name="Heroku" url="/admin" />
-
-    <general-page key="herokuApps" name="Heroku Apps" url="/apps"/>
-
-</remote-app>

views/register.ejs

+<remote-app key="<%=appKey%>" name="<%=appName%>" version="1" icon-url="http://heroku.com/favicon.ico"
+            display-url="<%=displayUrl%>">
+    <vendor name="Atlassian" url="http://atlassian.com" />
+    <description>
+        Heroku integration for associating JIRA projects with Heroku apps
+    </description>
+
+    <!--permissions>
+    </permissions-->
+
+    <entity-type key="app" name="App" pluralized-name="Apps" icon-url="http://heroku.com/favicon.ico"/>
+
+    <admin-page key="herokuAdmin" name="Heroku" url="/admin" />
+
+    <general-page key="herokuApps" name="Heroku Apps" 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 displayUrl = process.env.DISPLAY_URL || 'http://localhost:5000';
 var baseUrl = "https://remoteapps.jira.com";
 app.get('/', function(request, response) {
     response.send('Hello World!');
   });
 
+app.get('/register', function(request, response) {
+    response.contentType('text/xml');
+    response.render('register.ejs', {
+        displayUrl : displayUrl,
+        appKey : appKey,
+        appName : appName,
+        layout : false
+        });
+  });
+
 app.get('/admin', function(request, response) {
     response.render('admin.ejs', {
         baseUrl : baseUrl,