From 770c82cc8644c61649ca73b519ef9fb1dff45649 Mon Sep 17 00:00:00 2001
From: Ronnie Friman <L4168@student.jamk.fi>
Date: Tue, 23 Jul 2019 06:46:18 +0300
Subject: [PATCH] set images folder for static assets

---
 src/main.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main.ts b/src/main.ts
index ebd53e5..e0a6253 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,4 +1,6 @@
 import { NestFactory } from '@nestjs/core';
+import { NestExpressApplication } from '@nestjs/platform-express';
+import { join } from 'path';
 
 import { AppModule } from './app.module';
 
@@ -7,9 +9,10 @@ import { AppModule } from './app.module';
 */
 
 async function bootstrap() {
-  const app = await NestFactory.create(AppModule);
+  const app = await NestFactory.create<NestExpressApplication>(AppModule);
   // Cors is needed for application/json POST
   app.enableCors();
+  app.useStaticAssets(join(__dirname, '..', 'images'));
   await app.listen(5000);
 }
 bootstrap();
-- 
GitLab