Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zcpua committed Jul 16, 2023
1 parent 83bebbf commit 5c8c0c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { ConfigService } from '@nestjs/config';
import { FastifyAdapter } from '@nestjs/platform-fastify';

async function bootstrap() {
const app = await NestFactory.create(AppModule, new FastifyAdapter());
const app = await NestFactory.create(
AppModule,
new FastifyAdapter({
bodyLimit: 1024 * 1024 * 30, // 30MB
}),
);
const configService = app.get(ConfigService);
const port = configService.get('PORT') || 8080;
// Disable CORS
Expand Down
4 changes: 3 additions & 1 deletion src/midjourney.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export class MidjourneyService implements OnModuleInit {
Ws: true,
});
}
async onModuleInit() {}
async onModuleInit() {
await this.Midjourney.init();
}
async Imagine(prompt: string, loading?: (uri: string) => void) {
const msg = await this.Midjourney.Imagine(prompt, (uri: string) => {
loading && loading(uri);
Expand Down

0 comments on commit 5c8c0c9

Please sign in to comment.