BaseURL other than / makes troubles
See original GitHub issue@GavinJoyce we host our ember app in a subdirectory called /app, when I use Ember-Href-To the links does not work, because Ember-Href-To resolves the links to /app/app. We are using Ember-CLI and our environment.js looks as follows:
module.exports = function (environment) {
var ENV = {
environment: environment,
baseURL: '/app/'
// ...
// ...
}
return ENV;
}
I solved it by making my own helper based on Ember-Href-To. The helper looks as follows:
import Ember from 'ember';
import { hrefTo } from 'ember-href-to/helpers/href-to';
export function hrefToX(params/*, hash*/) {
var url = hrefTo(params);
var baseURL = APPENV.baseURL.replace(/\/$/, ''); // APPENV is globally available... jeah this is a relict from our old code from ember-cli 0.0.39
url = url.replace(baseURL, '');
return url;
}
export default Ember.Helper.helper(hrefToX);
It works but if I hover the links built with hrefToX the links dont contain the /app/. This does not happen with link-to. Is my solution the right way to go or is there a better way to do it?
Thanks a lot
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
BaseURL Problem: Cannot Change It – YouTrack Support
I removed everything in <username>\teamsysdata to reset the database and then restarted YouTrack. Now it works fine. 0.
Read more >android - Retrofit - Change BaseUrl - Stack Overflow
For some WebRequests , I must call the same API but on others, I must call it from a completely different BaseUrl ....
Read more >The Document Base URL element - HTML - MDN Web Docs
The HTML element specifies the base URL to use for all relative URLs in a document. There can be only one element in...
Read more >Cannot find a valid baseurl for repo : base problem
Set proxy information in the /etc/yum.conf, like this: proxy=http://xxx.xxx.xxx.xxx:1087 proxy_username= proxy_password=.
Read more >JIRA Displays an Error Banner about the Base URL | Jira
Click here to fix this problem.". ... Make sure that the base URL is correctly set and this same address is reachable from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
baseURL
is going to die 🔥 🔥 🔥 🔥 🔥 🔥 . See https://github.com/ember-cli/ember-cli/pull/5792 and a blog post we are working on in https://github.com/emberjs/website/pull/2569.baseURL
is dead as of 3.0. Nominate for closure.