-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
29 lines (26 loc) · 781 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
------------------------------------------------------------------------------
Author: devhoangkien
Website: https://devhoangkien.com
------------------------------------------------------------------------------
*/
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { graphqlUploadExpress } from "graphql-upload-minimal";
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// only using graphql
app.use((req: any, res: any, next: any) => {
if (req.url.includes('/graphql')) {
// only graphql request
graphqlUploadExpress({
maxFileSize: 1000000,
maxFiles: 10,
})(req, res, next);
} else {
next();
}
});
await app.listen(3000);
}
bootstrap();