Spaces:
Starting
Starting
Hetansh Waghela commited on
Commit ·
9fdeabf
1
Parent(s): 4a8127d
test: add TestController without global prefix
Browse files
apps/api/src/app.module.ts
CHANGED
|
@@ -18,6 +18,8 @@ import { ResolverModule } from "./resolver/resolver.module.js";
|
|
| 18 |
import { CaseLookupModule } from "./case-lookup/case-lookup.module.js";
|
| 19 |
import { ComplianceModule } from "./compliance/compliance.module.js";
|
| 20 |
import { UsersModule } from "./users/users.module.js";
|
|
|
|
|
|
|
| 21 |
@Module({
|
| 22 |
imports: [
|
| 23 |
DbModule,
|
|
@@ -40,6 +42,6 @@ import { UsersModule } from "./users/users.module.js";
|
|
| 40 |
ComplianceModule,
|
| 41 |
UsersModule,
|
| 42 |
],
|
| 43 |
-
controllers: [],
|
| 44 |
})
|
| 45 |
export class AppModule {}
|
|
|
|
| 18 |
import { CaseLookupModule } from "./case-lookup/case-lookup.module.js";
|
| 19 |
import { ComplianceModule } from "./compliance/compliance.module.js";
|
| 20 |
import { UsersModule } from "./users/users.module.js";
|
| 21 |
+
import { TestController } from "./test/test.controller.js";
|
| 22 |
+
|
| 23 |
@Module({
|
| 24 |
imports: [
|
| 25 |
DbModule,
|
|
|
|
| 42 |
ComplianceModule,
|
| 43 |
UsersModule,
|
| 44 |
],
|
| 45 |
+
controllers: [TestController],
|
| 46 |
})
|
| 47 |
export class AppModule {}
|
apps/api/src/main.ts
CHANGED
|
@@ -10,7 +10,6 @@ async function bootstrap() {
|
|
| 10 |
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter(), {
|
| 11 |
logger: ["error", "warn", "log"],
|
| 12 |
});
|
| 13 |
-
app.setGlobalPrefix("api");
|
| 14 |
app.enableCors({ origin: true });
|
| 15 |
|
| 16 |
const fastify = app.getHttpAdapter().getInstance();
|
|
|
|
| 10 |
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter(), {
|
| 11 |
logger: ["error", "warn", "log"],
|
| 12 |
});
|
|
|
|
| 13 |
app.enableCors({ origin: true });
|
| 14 |
|
| 15 |
const fastify = app.getHttpAdapter().getInstance();
|
apps/api/src/test/test.controller.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Controller, Get } from "@nestjs/common";
|
| 2 |
+
|
| 3 |
+
@Controller("test")
|
| 4 |
+
export class TestController {
|
| 5 |
+
@Get()
|
| 6 |
+
ping() {
|
| 7 |
+
return { ping: "pong" };
|
| 8 |
+
}
|
| 9 |
+
}
|