Add swagger integration
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
|
||||
import { IswordService } from './isword.service';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
|
||||
export type AreWordsDto = string[]
|
||||
|
||||
@ApiTags('dictionary')
|
||||
@Controller('isword')
|
||||
export class IswordController {
|
||||
constructor(
|
||||
|
@@ -7,7 +7,6 @@ export class IswordService {
|
||||
private readonly dictContents: string[];
|
||||
constructor() {
|
||||
this.dictContents = readFileSync(this.dict).toString().split('\n')
|
||||
|
||||
}
|
||||
|
||||
isWord = (word: string) =>
|
||||
|
@@ -1,8 +1,16 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('us.dev API')
|
||||
.setDescription("Chip's generalized API")
|
||||
.setVersion('1.0')
|
||||
.build();
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
SwaggerModule.setup('api', app, document);
|
||||
app.enableCors({origin: "*"});
|
||||
await app.listen(3000);
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { ParkioService } from './parkio.service';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@ApiTags('parkio')
|
||||
@Controller('parkio')
|
||||
export class ParkioController {
|
||||
constructor(
|
||||
|
Reference in New Issue
Block a user