Skip to content
This repository has been archived by the owner on Feb 4, 2018. It is now read-only.

Commit

Permalink
fix path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
freeman-lab committed Aug 24, 2016
1 parent a67b316 commit aace51d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ app.get('/repo/:org/:repo/status', function (req, res) {
return res.sendFile(path.join(staticPath, 'index.html'))
})

app.get('/repo/:org/:repo', function (req, res) {
app.get('/repo/:org/:repo/tree/:branch', function (req, res) {
return res.sendFile(path.join(staticPath, 'loading.html'))
})

app.get('/repo/:org/:repo/tree/:branch', function (req, res) {
app.get('/repo/:org/:repo*', function (req, res) {
return res.sendFile(path.join(staticPath, 'loading.html'))
})

Expand Down
7 changes: 3 additions & 4 deletions site/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ var apiServer = getOrigin()

var path = window.location.pathname.slice(6)
var split = path.split('/')
console.log('split', split)

var displayName = path
var deepLink = ''
var deepLink = (split.length > 2) ? '/' + split.slice(2).join('/') : ''
var displayName = path.indexOf('/tree') > -1 ? path : split.slice(0, 2).join('/')

// add logo
var header = document.createElement('div')
Expand Down Expand Up @@ -147,6 +145,7 @@ var makeSuccess = function () {
}

var templateName = displayName.replace('/tree', '').replace(/\//g, '-').toLowerCase()

async.waterfall([
function (next) {
request({
Expand Down

0 comments on commit aace51d

Please sign in to comment.