feat(api): user authentication

This commit is contained in:
Julian Tölle 2020-02-01 16:11:48 +01:00
parent f14eda16ac
commit f253a66f86
41 changed files with 657 additions and 338 deletions

View file

@ -1,14 +1,23 @@
import { NestFactory } from "@nestjs/core";
import { NestExpressApplication } from "@nestjs/platform-express";
import { join } from "path";
import { DocumentBuilder, SwaggerModule } from "@nestjs/swagger";
import { AppModule } from "./app.module";
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.useStaticAssets(join(__dirname, "frontend", "public"));
app.setBaseViewsDir(join(__dirname, "frontend", "views"));
app.setViewEngine("mustache");
// Setup API Docs
const options = new DocumentBuilder()
.setTitle("Listory")
.setDescription("Track and analyze your Spotify Listens")
.setVersion("1.0")
.addBearerAuth()
.addTag("user")
.addTag("listens")
.addTag("auth")
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup("api/docs", app, document);
await app.listen(3000);
}