Initial Commit
This commit is contained in:
@@ -15,6 +15,7 @@ import errorPlugin from './core/plugins/error.plugin';
|
||||
import { vehiclesRoutes } from './features/vehicles/api/vehicles.routes';
|
||||
import { fuelLogsRoutes } from './features/fuel-logs/api/fuel-logs.routes';
|
||||
import { stationsRoutes } from './features/stations/api/stations.routes';
|
||||
import tenantManagementRoutes from './features/tenant-management/index';
|
||||
|
||||
async function buildApp(): Promise<FastifyInstance> {
|
||||
const app = Fastify({
|
||||
@@ -30,6 +31,8 @@ async function buildApp(): Promise<FastifyInstance> {
|
||||
// Authentication plugin
|
||||
await app.register(authPlugin);
|
||||
|
||||
// Tenant detection is applied at route level after authentication
|
||||
|
||||
// Health check
|
||||
app.get('/health', async (_request, reply) => {
|
||||
return reply.code(200).send({
|
||||
@@ -44,6 +47,7 @@ async function buildApp(): Promise<FastifyInstance> {
|
||||
await app.register(vehiclesRoutes, { prefix: '/api' });
|
||||
await app.register(fuelLogsRoutes, { prefix: '/api' });
|
||||
await app.register(stationsRoutes, { prefix: '/api' });
|
||||
await app.register(tenantManagementRoutes);
|
||||
|
||||
// Maintenance feature placeholder (not yet implemented)
|
||||
await app.register(async (fastify) => {
|
||||
@@ -83,4 +87,4 @@ export async function getApp(): Promise<FastifyInstance> {
|
||||
return appInstance;
|
||||
}
|
||||
|
||||
export default buildApp;
|
||||
export default buildApp;
|
||||
|
||||
Reference in New Issue
Block a user