add .htaccess + url parameter

This commit is contained in:
_Bastler 2021-09-23 10:14:35 +02:00
parent 885c95e63b
commit dd3eda2fd3
3 changed files with 16 additions and 0 deletions

View File

@ -24,6 +24,7 @@
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/.htaccess",
"src/favicon.ico",
"src/assets"
],

8
src/.htaccess Normal file
View File

@ -0,0 +1,8 @@
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteCond %{REQUEST_URI} !^/api/.*$
RewriteRule ^ - [L]
RewriteRule ^ /index.html [L]

View File

@ -40,6 +40,7 @@ export class UrlShortenerComponent implements OnInit {
private formBuilder: FormBuilder,
private urlShortenerService: UrlShortenerService,
private i18n: I18nService,
private route: ActivatedRoute,
public dialog: MatDialog) { }
ngOnInit(): void {
@ -65,6 +66,12 @@ export class UrlShortenerComponent implements OnInit {
})
})
this.route.queryParams.subscribe(params => {
if (params.url) {
this.shortenedUrl.url = params.url;
}
})
this.refresh();
}