Skip to content
Snippets Groups Projects
Commit 65013424 authored by PASQUIER-TROIANO AZZO's avatar PASQUIER-TROIANO AZZO
Browse files

fix: main was not in the project anymore

parent 5feb9026
1 merge request!62feature: added injections to runmodule and quizmodule, you can now use 'start'...
Pipeline #312154 passed with stages
in 1 minute and 29 seconds
......@@ -37,26 +37,6 @@ export class QuizController {
}
}
@Post('import')
async importQuestions(
@Body() body: { amount: number; category: number; difficulty: string },
) {
try {
const { amount, category, difficulty } = body;
return await this.quizService.importQuestions(
amount,
category,
difficulty,
);
} catch (error) {
console.error('Error in importQuestions:', error);
throw new HttpException(
'Failed to import questions',
HttpStatus.BAD_REQUEST,
);
}
}
@Post('create')
async createQuiz(
@Body() body: { amount: number; category: number; difficulty: string },
......
import * as cookieParser from 'cookie-parser';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { readFileSync } from 'fs';
async function bootstrap() {
/*const httpsOptions = {
key: readFileSync(process.env.SSL_PRIVKEY, 'utf8'),
cert: readFileSync(process.env.SSL_CERTIFICAT, 'utf8'),
};*/
const app = await NestFactory.create(AppModule);
app.use(cookieParser());
app.enableCors({
origin: [
'http://klebert-host.com:33040',
'http://klebert-host.com:33037',
'http://localhost:4200',
],
credentials: true,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
allowedHeaders: 'Content-Type, Accept, Authorization',
});
await app.listen(process.env.PORT ?? 3000);
}
bootstrap();
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment