Commit dfc93e11 authored by David de Castro Campos's avatar David de Castro Campos
Browse files

Merge branch 'no-us/minor-fixes' into 'dev'

[feat] standardize npm scripts and fixing lint / typo

See merge request creative-flow/creative-flow-backend!6
parents 396cc1ef 58f6d729
Showing with 9 additions and 5 deletions
+9 -5
......@@ -9,8 +9,8 @@
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"dev": "nest start --watch",
"dev:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
......
......@@ -3,7 +3,7 @@ import { Controller, Delete, Get, HttpStatus, Post } from '@nestjs/common';
import { BoilerplateService } from '../services/boilerplate.service';
import { ApiTags } from '@nestjs/swagger';
@ApiTags('Boierplates') // Swagger Tag
@ApiTags('Boilerplates') // Swagger Tag
@Controller('boilerplates') // Base route
export class BoilerplateController {
// eslint-disable-next-line no-unused-vars
......
......@@ -3,6 +3,8 @@ import { AppModule } from './modules/app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { json, urlencoded } from 'express';
const DEFAULT_PORT = 8080;
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
......@@ -17,6 +19,6 @@ async function bootstrap() {
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('docs', app, document);
await app.listen(process.env.PORT ?? 8080);
await app.listen(process.env.PORT ?? DEFAULT_PORT);
}
void bootstrap();
......@@ -4,6 +4,8 @@ import * as request from 'supertest';
import { App } from 'supertest/types';
import { AppModule } from '../src/modules/app.module';
const SUCCESS_CODE = 200;
describe('AppController (e2e)', () => {
let app: INestApplication<App>;
......@@ -19,7 +21,7 @@ describe('AppController (e2e)', () => {
it('/ (GET)', () => {
return request(app.getHttpServer())
.get('/')
.expect(200)
.expect(SUCCESS_CODE)
.expect('Hello World!');
});
});
Markdown is supported
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