feat: default locale Russian, geo determines language for other countries
- localization-svc: defaultLocale ru, resolveLocale only by geo - web-svc: DEFAULT_LOCALE ru, layout lang=ru, embeddedTranslations fallback ru - countryToLocale: default ru when no country or unknown country Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
43
services/audit-svc/src/index.ts
Normal file
43
services/audit-svc/src/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* audit-svc — Enterprise audit logs
|
||||
* docs/architecture: 01-perplexity-analogue-design.md §5.12, §2.2.N
|
||||
* API: GET /api/v1/admin/audit-logs?from=&to=&userId=
|
||||
*/
|
||||
|
||||
import Fastify from 'fastify';
|
||||
import cors from '@fastify/cors';
|
||||
|
||||
const PORT = parseInt(process.env.PORT ?? '3012', 10);
|
||||
|
||||
const app = Fastify({ logger: true });
|
||||
|
||||
await app.register(cors, { origin: true });
|
||||
|
||||
app.get('/health', async () => ({ status: 'ok' }));
|
||||
app.get('/ready', async () => ({ status: 'ready' }));
|
||||
app.get('/metrics', async (_req, reply) => {
|
||||
reply.header('Content-Type', 'text/plain; charset=utf-8');
|
||||
return reply.send(
|
||||
'# HELP gooseek_up Service is up (1) or down (0)\n' +
|
||||
'# TYPE gooseek_up gauge\n' +
|
||||
'gooseek_up 1\n'
|
||||
);
|
||||
});
|
||||
|
||||
app.get<{
|
||||
Querystring: { from?: string; to?: string; userId?: string };
|
||||
}>('/api/v1/admin/audit-logs', async (req, reply) => {
|
||||
return reply.send({
|
||||
items: [],
|
||||
_stub: true,
|
||||
message: 'Audit logs require Enterprise. Configure POSTGRES_URL and enable logging.',
|
||||
});
|
||||
});
|
||||
|
||||
try {
|
||||
await app.listen({ port: PORT, host: '0.0.0.0' });
|
||||
console.log('audit-svc listening on :' + PORT);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user