1 | var staticLocation = require('./staticLocation')
|
2 |
|
3 | var helperGetLocatOrigin = require('./helperGetLocatOrigin')
|
4 |
|
5 | var lastIndexOf = require('./lastIndexOf')
|
6 |
|
7 | function getBaseURL () {
|
8 | if (staticLocation) {
|
9 | var pathname = staticLocation.pathname
|
10 | var lastIndex = lastIndexOf(pathname, '/') + 1
|
11 | return helperGetLocatOrigin() + (lastIndex === pathname.length ? pathname : pathname.substring(0, lastIndex))
|
12 | }
|
13 | return ''
|
14 | }
|
15 |
|
16 | module.exports = getBaseURL
|