chore: added docker files for bringing the container up
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user