Skip to content

baseURL option support. #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

baseURL option support. #39

wants to merge 3 commits into from

Conversation

lesion
Copy link

@lesion lesion commented Sep 4, 2016

Needed if you want to host reStore without a domain for itself alone.
Let's say you own your 'www.example.com' and want to host reStore
at 'www.example.com/reStore' now you can.

This PR introduces a new baseURL option you can use for this.

Needed if you want to host reStore without a domain for itself alone.
Let's say you own your 'www.example.com' and want to host reStore
at 'www.example.com/reStore' now you can.

This PR introduces a new `baseURL` option you can use for this.
@lesion
Copy link
Author

lesion commented Sep 5, 2016

Initially thought this was not a good idea 'cause your remoteStorage address would be user@domain/path
but I cannot find a reason why this could be bad.
Searched in remoteStorage specification and can't find if this is specified or not !

I'm trying laverna.cc with this PR and currently is not working (i'm stuck after oauth and before /storage call)

@lesion
Copy link
Author

lesion commented Sep 5, 2016

this last commit fix the issue, i'm currently using with this setup :)

@raucao
Copy link
Contributor

raucao commented Sep 5, 2016

Initially thought this was not a good idea 'cause your remoteStorage address would be user@domain/path
but I cannot find a reason why this could be bad.
Searched in remoteStorage specification and can't find if this is specified or not !

As long as Webfinger is there under the normal well-known URL(s), there's nothing that should prevent you from doing it that way. It's mostly a security question, because your storage is then on the same origin as other things, but it's not a problem per se.

}

// remove baseURL and eventually a final '/' before real path
uri.pathname = uri.pathname.replace(startBaseURL, '')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace with '/' instead of '' and avoid all those changes to the regexes further below.

@untitaker
Copy link

I'd rather call the variable basePath.

- s/baseURL/basePath/
- better regexp
@lesion
Copy link
Author

lesion commented Sep 7, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants