feat: Respect root path for static assets and HTML links

* feat: rootpath for static assets and links1

* fix: static asset handler respects root path

* fix: use rootPath for links

* tests: fix the tests after adding consuctor params

* feat: change matchregex instead of stored URLs

* feat: baseUrl for handlebar engine and templates

* feat: full baseUrl passed to templates

* test: fix integration tests + templates

* chore: implement requested changes

* docs: Describe TemplateEngine interface changes

Co-authored-by: Joachim Van Herwegen <joachimvh@gmail.com>
This commit is contained in:
Jasper Vaneessen
2022-05-24 10:20:41 +02:00
committed by GitHub
parent 771d138037
commit 2814e72b34
26 changed files with 105 additions and 43 deletions

View File

@@ -20,7 +20,7 @@ describe('A StaticAssetHandler', (): void => {
'/foo/bar/folder1/': '/assets/folders/1/',
'/foo/bar/folder2/': '/assets/folders/2',
'/foo/bar/folder2/subfolder/': '/assets/folders/3',
});
}, 'http://localhost:3000');
afterEach(jest.clearAllMocks);
@@ -217,7 +217,7 @@ describe('A StaticAssetHandler', (): void => {
jest.spyOn(Date, 'now').mockReturnValue(0);
const cachedHandler = new StaticAssetHandler({
'/foo/bar/style': '/assets/styles/bar.css',
}, {
}, 'http://localhost:3000', {
expires: 86400,
});
const request = { method: 'GET', url: '/foo/bar/style' };