Spaces:
Runtime error
Runtime error
Add root status handler for direct visits
Browse files- src/app.controller.ts +14 -0
- src/app.module.ts +2 -0
src/app.controller.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Controller, Get } from '@nestjs/common';
|
| 2 |
+
|
| 3 |
+
@Controller()
|
| 4 |
+
export class AppController {
|
| 5 |
+
@Get()
|
| 6 |
+
getHello() {
|
| 7 |
+
return {
|
| 8 |
+
status: 'active',
|
| 9 |
+
service: 'Kodelyx API Server',
|
| 10 |
+
message: 'Welcome to the backend API. Please use the frontend client to interact.',
|
| 11 |
+
timestamp: new Date().toISOString(),
|
| 12 |
+
};
|
| 13 |
+
}
|
| 14 |
+
}
|
src/app.module.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
import { Module } from '@nestjs/common';
|
| 2 |
import { AuthModule } from './auth/auth.module';
|
| 3 |
import { PrismaService } from './prisma.service';
|
|
|
|
| 4 |
|
| 5 |
@Module({
|
| 6 |
imports: [AuthModule],
|
|
|
|
| 7 |
providers: [PrismaService],
|
| 8 |
})
|
| 9 |
export class AppModule {}
|
|
|
|
| 1 |
import { Module } from '@nestjs/common';
|
| 2 |
import { AuthModule } from './auth/auth.module';
|
| 3 |
import { PrismaService } from './prisma.service';
|
| 4 |
+
import { AppController } from './app.controller';
|
| 5 |
|
| 6 |
@Module({
|
| 7 |
imports: [AuthModule],
|
| 8 |
+
controllers: [AppController],
|
| 9 |
providers: [PrismaService],
|
| 10 |
})
|
| 11 |
export class AppModule {}
|