From 8f1b4cd9f3fa1622d9976494ba2b64bc79a71bca Mon Sep 17 00:00:00 2001
From: Sami Spets <savasp@utu.fi>
Date: Wed, 25 Sep 2019 07:56:10 +0300
Subject: [PATCH] Added seeds.js

---
 web-service/server/src/index.js |  8 ++++++--
 web-service/server/src/seeds.js | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 web-service/server/src/seeds.js

diff --git a/web-service/server/src/index.js b/web-service/server/src/index.js
index c4062d542..0e4062f95 100644
--- a/web-service/server/src/index.js
+++ b/web-service/server/src/index.js
@@ -154,7 +154,7 @@ app.get('/stream/depth', (req, res) => {
 //app.get('/stream', (req, res))
 
 /** 
- * Route for Google authentication API
+ * Route for Google authentication API page
 */
 app.get('/google', passport.authenticate('google', {
 	scope: ['profile']
@@ -162,7 +162,7 @@ app.get('/google', passport.authenticate('google', {
 
 /** 
  * Google authentication API callback route. 
- * Sets the JWT to clients browser and redirects the user back to React app.
+ * Sets the JWT to clients browser and redirects the user back to front page (now has thumbnails).
 */
 app.get('/auth/google/redirect', passport.authenticate('google'), (req, res) => {
 	console.log(req.user)
@@ -201,6 +201,10 @@ function broadcastExcept(exc, name, ...args) {
 	}
 }
 
+/**
+ * Need to think about how to use these.
+ * Will it be in the '/' route or in the '/streams/<stream>' route
+ */
 app.ws('/', (ws, req) => {
 	console.log("New web socket request");
 
diff --git a/web-service/server/src/seeds.js b/web-service/server/src/seeds.js
new file mode 100644
index 000000000..8cd4d670d
--- /dev/null
+++ b/web-service/server/src/seeds.js
@@ -0,0 +1,18 @@
+
+/**
+ * This is a test db intended to have some random data
+ * to be used for testing thumbnail (and why not something else)
+ */
+
+ const testData = {
+     thumbnail: [
+         {
+            name: 'source2',
+            frame: 'https://images.unsplash.com/photo-1564969982505-4c27fbfe7a1c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80'
+         },
+         {
+            name: 'source2',
+            frame: ''
+         },
+     ]
+ }
\ No newline at end of file
-- 
GitLab