diff --git a/app/assets/index.html b/app/assets/index.squirrelly similarity index 99% rename from app/assets/index.html rename to app/assets/index.squirrelly index cc045ce..0aedc59 100644 --- a/app/assets/index.html +++ b/app/assets/index.squirrelly @@ -56,8 +56,10 @@
diff --git a/bin/deploy.sh b/bin/deploy.sh index 45eb967..b8c640e 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -7,6 +7,6 @@ npm run server:build rm -rf public/* npm run client:build rsync -rvpLz --delete -e ssh bin dist node_modules public rob@ccmi.fit.cvut.cz:$D -rsync -rvpLz --delete -e ssh data rob@ccmi.fit.cvut.cz:$D -#rsync -rvpLz --ignore-existing -e ssh data rob@ccmi.fit.cvut.cz:$D +#rsync -rvpLz --delete -e ssh data rob@ccmi.fit.cvut.cz:$D +rsync -rvpLz --ignore-existing -e ssh data rob@ccmi.fit.cvut.cz:$D diff --git a/package-lock.json b/package-lock.json index ad0b874..c8b56e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6243,6 +6243,11 @@ "resolved": "https://registry.npmjs.org/split.js/-/split.js-1.5.11.tgz", "integrity": "sha512-ec0sAbWnaMGpNHWo1ZgIlF3Mx7GzSyaO0GlcEBZGIFZQwYPPkbDV6JRpDmpzIshVig7USREuEPudy0ygQaskXg==" }, + "squirrelly": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/squirrelly/-/squirrelly-7.1.1.tgz", + "integrity": "sha512-RzlylFphf6Bus0dEnr6PLdZErRFC1SUGfH5E6Vcs7dGFgrJOPVKTJy1DovinWIjnsdymwN2CTj5SlWqoWjebQQ==" + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", diff --git a/package.json b/package.json index ce0159d..f7a6921 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "private": "true", "main": "index.js", "scripts": { - "server:watch": "rm -rf dist/*; nodemon --watch server --exec npm run server:build\\; npm run server:run", - "server:build": "rm -rf dist/*; babel -d dist server", + "server:watch": "rm -rf dist/*; cp -r server/views dist; nodemon --watch server --exec npm run server:build\\; npm run server:run", + "server:build": "rm -rf dist/*; cp -r server/views dist; babel -d dist server", "server:run": "cd dist; node server", "client:watch": "brunch watch --server", "client:build": "brunch build --production", @@ -61,6 +61,7 @@ "react-confirm-bootstrap": "^5.3.0", "react-dom": "^16.8.6", "react-split": "^2.0.5", + "squirrelly": "^7.1.1", "vis": "^4.21.0" } } diff --git a/server/app.js b/server/app.js index c9369dd..40efe51 100644 --- a/server/app.js +++ b/server/app.js @@ -1,6 +1,5 @@ //@flow -// Imports {{{1 const express = require('express'); const cors = require('cors'); const path = require('path'); @@ -8,6 +7,7 @@ const cookieParser = require('cookie-parser'); const logger = require('morgan'); const ufoaRouter = require('./ufoa/router'); const ufobRouter = require('./ufob/router'); +const secrets = require('./secrets'); var app = express(); @@ -17,10 +17,15 @@ app.use(express.json()); app.use(express.urlencoded({ extended: false })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, '../public'))); +app.set('view engine', 'squirrelly'); +app.get('/' + secrets.adminURL, (req, res: any) => { + res.render('index.squirrelly', { admin: true }); +}); app.get('/', (req, res: any) => { - res.status(200).render('index.html'); + res.render('index.squirrelly', { admin: false }); }); + app.use('/', ufoaRouter); app.use('/', ufobRouter); diff --git a/server/secrets.js b/server/secrets.js new file mode 100644 index 0000000..3259c53 --- /dev/null +++ b/server/secrets.js @@ -0,0 +1,3 @@ +//@flow + +export const adminURL: string = "admin119905"; diff --git a/server/views/index.squirrelly b/server/views/index.squirrelly new file mode 100644 index 0000000..7ff6cfc --- /dev/null +++ b/server/views/index.squirrelly @@ -0,0 +1,274 @@ + + + + + + +