Skip to content

Commit

Permalink
Default value for BACKEND_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
oktaal committed Jul 18, 2024
1 parent 47d3299 commit 2e01512
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"app_prefix": "dh",
"description": "{{cookiecutter.project_title}} will humanize all your digits!",
"author": "Research Software Lab, Centre for Digital Humanities, Utrecht University",
"author_url": "https://cdh.uu.nl/centre-for-digital-humanities/research-software-lab/",
"author_url": "https://cdh.uu.nl/about/research-software-lab/",
"origin": "github:CentreForDigitalHumanities/{{cookiecutter.slug}}",
"database_name": "{{cookiecutter.slug}}",
"database_user": "{{cookiecutter.slug}}",
Expand Down
15 changes: 8 additions & 7 deletions {{cookiecutter.slug}}/frontend.angular/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import { provideRouter } from '@angular/router';

import { routes } from './app.routes';

export const BACKEND_URL = new InjectionToken<string>('BackendUrl');
export const BACKEND_URL = new InjectionToken<string>('BackendUrl', {
// because proxy doesn't work for SSR, support a wonky workaround
// by manually specifying the URL where the backend is running
// https://github.com/angular/angular-cli/issues/27144
// By default it is empty, because in the browser this isn't needed
factory: () => ''
});

export const appConfig: ApplicationConfig = {
providers: [
Expand All @@ -27,11 +33,6 @@ export const appConfig: ApplicationConfig = {
// the root e.g. /home
// The server should then switch index.html based on a language
// cookie with a fallback to Dutch e.g. /nl/static/index.html
{ provide: APP_BASE_HREF, useValue: '/' },
// because proxy doesn't work for SSR, support a wonky workaround
// by manually specifying the URL where the backend is running
// https://github.com/angular/angular-cli/issues/27144
// By default it is empty, because in the browser this isn't needed
{ provide: BACKEND_URL, useValue: '' }
{ provide: APP_BASE_HREF, useValue: '/' }
]
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1 class="subtitle" i18n>{{cookiecutter.project_title}}</h1>
</div>
<div class="column has-text-right-tablet is-narrow">
<a class="centre-logo image"
href="https://cdh.uu.nl/centre-for-digital-humanities/research-software-lab/" target="_blank">
href="https://cdh.uu.nl/about/research-software-lab/" target="_blank">
<img [src]="environment.assets + (dark ? '/uu-cdh-dark.svg' :'/uu-cdh.svg')"
alt="Centre for Digital Humanities, Utrecht University" i18n-alt width="450" height="105" />
</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<figure>
<figcaption><i>Powered by</i></figcaption>
<a href="https://cdh.uu.nl/centre-for-digital-humanities/research-software-lab/">
<a href="https://cdh.uu.nl/about/research-software-lab/">
<img title="Centre for Digital Humanities, Utrecht University"
alt="Centre for Digital Humanities, Utrecht University"
src="{% raw %}{{static 'image/uu-cdh.svg'}}{% endraw %}"
Expand Down

0 comments on commit 2e01512

Please sign in to comment.