chore: added docker files for bringing the container up

This commit is contained in:
ankitsridhar16
2022-12-06 13:18:02 +05:30
parent 1dc804a2b9
commit 333dbba393
10 changed files with 980 additions and 19 deletions

View File

@@ -1,8 +1,40 @@
import { NestFactory } from '@nestjs/core';
import { json } from 'express';
import { AppModule } from './app.module';
async function bootstrap() {
console.log(`Running in production: ${process.env.PRODUCTION}`);
console.log(`Port: ${process.env.PORT}`);
console.log(`Database: ${process.env.DATABASE_URL}`);
const app = await NestFactory.create(AppModule);
await app.listen(3000);
// Increase fil upload limit to 50MB
app.use(
json({
limit: '100mb',
}),
);
if (process.env.PRODUCTION === 'false') {
console.log('Enabling CORS with development settings');
app.enableCors({
origin: true,
});
} else {
console.log('Enabling CORS with production settings');
// HACK: Temporary fix for Liyas to work on production directly :P
/*
app.enableCors({
origin: /hoppscotch\.io$/
});
*/
app.enableCors({
origin: true,
});
}
await app.listen(process.env.PORT || 3170);
}
bootstrap();