From 6c92953a05f225c63cc9f60258e94407f810ddb4 Mon Sep 17 00:00:00 2001
From: Markus Opolka <markus@martialblog.de>
Date: Tue, 16 Jan 2018 08:13:18 +0100
Subject: [PATCH] Add static path to express server to serve app

---
 api.js => app.js   | 2 ++
 package.json       | 4 ++--
 run.bat.example    | 5 ++---
 update.bat.example | 5 +++++
 4 files changed, 11 insertions(+), 5 deletions(-)
 rename api.js => app.js (99%)
 create mode 100644 update.bat.example

diff --git a/api.js b/app.js
similarity index 99%
rename from api.js
rename to app.js
index dee9338..9b9874d 100755
--- a/api.js
+++ b/app.js
@@ -134,6 +134,8 @@ app.use(function (req, res, next) {
   next()
 })
 
+app.use('/', express.static('dist'))
+
 app.get('/api/search', function (req, res) {
   // Search Endpoint with query parameters
   // <element attribute="value">content</element>
diff --git a/package.json b/package.json
index 4a57fbc..5ccc7f4 100644
--- a/package.json
+++ b/package.json
@@ -1,11 +1,11 @@
 {
   "name": "massicot-letters",
   "version": "1.0.0",
-  "description": "Massicot Letter Project",
+  "description": "FAU Massicot Letter Project",
   "author": "Markus Opolka <markus@martialblog.de>",
   "private": true,
   "scripts": {
-    "api": "node api.js",
+    "app": "node app.js",
     "dev": "node build/dev-server.js",
     "start": "npm run dev",
     "build": "node build/build.js",
diff --git a/run.bat.example b/run.bat.example
index b36fc5e..2293cde 100644
--- a/run.bat.example
+++ b/run.bat.example
@@ -1,5 +1,4 @@
-REM Windows Script to Start API
+REM Windows Script to Start App
 CD C:/
 CALL git pull
-CALL npm install --production
-CALL node api.js
+CALL node app.js
diff --git a/update.bat.example b/update.bat.example
new file mode 100644
index 0000000..c64e0ed
--- /dev/null
+++ b/update.bat.example
@@ -0,0 +1,5 @@
+REM Windows Script to Update App
+CD C:/
+CALL git pull
+CALL npm install
+CALL npm run build
-- 
GitLab