diff --git a/src/api/api.module.ts b/src/api/api.module.ts index 8a765fee..0a3e6bc4 100644 --- a/src/api/api.module.ts +++ b/src/api/api.module.ts @@ -7,6 +7,7 @@ import { MemberModule } from './member/member.module'; import { MatchModule } from './match/match.module'; import { HealthModule } from './health/health.module'; import { InternalIdentifiersModule } from './internal-identifiers/internal-identifiers.module'; +import { UserAgentModule } from './user-agent/user-agent.module'; @Module({ imports: [ @@ -17,6 +18,7 @@ import { InternalIdentifiersModule } from './internal-identifiers/internal-ident MemberModule, MatchModule, HealthModule, + UserAgentModule, InternalIdentifiersModule, ], }) diff --git a/src/api/user-agent/user-agent.controller.ts b/src/api/user-agent/user-agent.controller.ts new file mode 100644 index 00000000..41251c19 --- /dev/null +++ b/src/api/user-agent/user-agent.controller.ts @@ -0,0 +1,13 @@ +import { Controller, Get } from '@nestjs/common'; +import { UserAgentsUtil } from '../../common/utils/user-agents.util'; + +@Controller({ + path: 'user-agent', + version: '1', +}) +export class UserAgentController { + @Get('random') + generateRandomUserAgent() { + return { ua: UserAgentsUtil.random }; + } +} diff --git a/src/api/user-agent/user-agent.module.ts b/src/api/user-agent/user-agent.module.ts new file mode 100644 index 00000000..f560140b --- /dev/null +++ b/src/api/user-agent/user-agent.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { UserAgentController } from './user-agent.controller'; + +@Module({ + imports: [], + controllers: [UserAgentController], +}) +export class UserAgentModule { +}