add .htaccess + url parameter
This commit is contained in:
parent
885c95e63b
commit
dd3eda2fd3
@ -24,6 +24,7 @@
|
|||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"aot": true,
|
"aot": true,
|
||||||
"assets": [
|
"assets": [
|
||||||
|
"src/.htaccess",
|
||||||
"src/favicon.ico",
|
"src/favicon.ico",
|
||||||
"src/assets"
|
"src/assets"
|
||||||
],
|
],
|
||||||
|
8
src/.htaccess
Normal file
8
src/.htaccess
Normal 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]
|
@ -40,6 +40,7 @@ export class UrlShortenerComponent implements OnInit {
|
|||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private urlShortenerService: UrlShortenerService,
|
private urlShortenerService: UrlShortenerService,
|
||||||
private i18n: I18nService,
|
private i18n: I18nService,
|
||||||
|
private route: ActivatedRoute,
|
||||||
public dialog: MatDialog) { }
|
public dialog: MatDialog) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
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();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user