feat: public GET /manifest.json from tenant branding
Serve PWA/APK web manifest per domain (name, theme colors, multi-size icons from avatar), exclude from api prefix, and proxy via nginx. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { Controller, Get, Header, Headers, Query } from '@nestjs/common';
|
||||
import { GetUserService } from '../get-user/get-user.service';
|
||||
|
||||
@Controller()
|
||||
export class GetManifestController {
|
||||
constructor(private readonly getUserService: GetUserService) {}
|
||||
|
||||
@Get('manifest.json')
|
||||
@Header('Content-Type', 'application/manifest+json; charset=utf-8')
|
||||
@Header('Cache-Control', 'public, max-age=300')
|
||||
getManifest(
|
||||
@Headers('host') host?: string,
|
||||
@Headers('x-forwarded-host') forwardedHost?: string,
|
||||
@Query('domain') domain?: string,
|
||||
) {
|
||||
return this.getUserService.resolveManifestByHost(
|
||||
domain || forwardedHost || host,
|
||||
domain,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { GetUserModule } from '../get-user/get-user.module';
|
||||
import { GetManifestController } from './get-manifest.controller';
|
||||
|
||||
@Module({
|
||||
imports: [GetUserModule],
|
||||
controllers: [GetManifestController],
|
||||
})
|
||||
export class GetManifestModule {}
|
||||
Reference in New Issue
Block a user