fix: email templates not being included in builds
feat: implement nginx proxy
This commit is contained in:
parent
65b957fbc2
commit
5c927a26cd
13 changed files with 10 additions and 8 deletions
|
@ -4,6 +4,7 @@
|
|||
"sourceRoot": "src",
|
||||
"compilerOptions": {
|
||||
"deleteOutDir": true,
|
||||
"plugins": ["@nestjs/swagger"]
|
||||
"plugins": ["@nestjs/swagger"],
|
||||
"assets": ["**/*.hbs", "**/*.txt"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,9 @@ export class ViewLoginGuard implements CanActivate {
|
|||
'/',
|
||||
];
|
||||
|
||||
if (loginPages.includes(context.switchToHttp().getRequest().url)) {
|
||||
// remove the query string
|
||||
const url = context.switchToHttp().getRequest().url.split('?')[0];
|
||||
if (loginPages.includes(url)) {
|
||||
if (authType === 'session') {
|
||||
response.redirect('/home');
|
||||
return false;
|
||||
|
|
|
@ -111,7 +111,7 @@ export class MailService {
|
|||
*/
|
||||
private async readHtmlTemplate(templateName: string): Promise<string> {
|
||||
return (
|
||||
await readFile(path.join(__dirname, '../..', 'mail/html', `${templateName}.hbs`))
|
||||
await readFile(path.join(__dirname, '../..', 'resources/mail/html', `${templateName}.hbs`))
|
||||
).toString();
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ export class MailService {
|
|||
*/
|
||||
private async readTextTemplate(templateName: string): Promise<string> {
|
||||
return (
|
||||
await readFile(path.join(__dirname, '../..', 'mail/text', `${templateName}.txt`))
|
||||
await readFile(path.join(__dirname, '../..', 'resources/mail/text', `${templateName}.txt`))
|
||||
).toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,14 +32,14 @@ http {
|
|||
#OIDC Provider
|
||||
location /oidc/ {
|
||||
resolver 127.0.0.11 valid=30s; # Docker DNS
|
||||
proxy_pass http://host.docker.internal:3001/api/; # Local back end
|
||||
proxy_pass http://host.docker.internal:3001/oidc/; # Local back end
|
||||
proxy_redirect default;
|
||||
}
|
||||
|
||||
#Frontend Next.js App
|
||||
location / {
|
||||
resolver 127.0.0.11 valid=30s; # Docker DNS
|
||||
proxy_pass http://host.docker.internal:3000/; # Local back end
|
||||
proxy_pass http://host.docker.internal:3001/; # Local back end
|
||||
proxy_redirect default;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,7 @@ services:
|
|||
- "6379:6379"
|
||||
|
||||
nginx:
|
||||
container_name: nginx-local-dev-proxy
|
||||
image: nginx:1.21.3
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- target: 80
|
||||
published: 80
|
||||
|
|
Loading…
Reference in a new issue