diff --git a/src/client-static/images/icons/icon-128x128.png b/src/client-static/images/icons/icon-128x128.png new file mode 100644 index 000000000..fbf19dc54 Binary files /dev/null and b/src/client-static/images/icons/icon-128x128.png differ diff --git a/src/client-static/images/icons/icon-144x144.png b/src/client-static/images/icons/icon-144x144.png new file mode 100644 index 000000000..bc3d73139 Binary files /dev/null and b/src/client-static/images/icons/icon-144x144.png differ diff --git a/src/client-static/images/icons/icon-152x152.png b/src/client-static/images/icons/icon-152x152.png new file mode 100644 index 000000000..4f27e38bd Binary files /dev/null and b/src/client-static/images/icons/icon-152x152.png differ diff --git a/src/client-static/images/icons/icon-196x196.png b/src/client-static/images/icons/icon-196x196.png new file mode 100644 index 000000000..a50401d70 Binary files /dev/null and b/src/client-static/images/icons/icon-196x196.png differ diff --git a/src/client-static/images/icons/icon-256x256.png b/src/client-static/images/icons/icon-256x256.png new file mode 100644 index 000000000..6282479ad Binary files /dev/null and b/src/client-static/images/icons/icon-256x256.png differ diff --git a/src/client-static/images/icons/icon-512x512.png b/src/client-static/images/icons/icon-512x512.png new file mode 100644 index 000000000..4625da3fc Binary files /dev/null and b/src/client-static/images/icons/icon-512x512.png differ diff --git a/src/client-static/images/icons/icon-72x72.png b/src/client-static/images/icons/icon-72x72.png new file mode 100644 index 000000000..4881f71e0 Binary files /dev/null and b/src/client-static/images/icons/icon-72x72.png differ diff --git a/src/client-static/images/logo-90x90.svg b/src/client-static/images/logo-90x90.svg new file mode 100644 index 000000000..7e24a831b --- /dev/null +++ b/src/client-static/images/logo-90x90.svg @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/src/client-static/manifest.json b/src/client-static/manifest.json new file mode 100644 index 000000000..d890cbe46 --- /dev/null +++ b/src/client-static/manifest.json @@ -0,0 +1,47 @@ +{ + "name": "Farajaland CRS", + "short_name": "Farajaland CRS", + "theme_color": "#4c68c1", + "background_color": "#4c68c1", + "display": "standalone", + "scope": "/", + "start_url": "/", + "icons": [ + { + "src": "images/icons/icon-72x72.png", + "sizes": "72x72", + "type": "image/png" + }, + { + "src": "images/icons/icon-128x128.png", + "sizes": "128x128", + "type": "image/png" + }, + { + "src": "images/icons/icon-144x144.png", + "sizes": "144x144", + "type": "image/png" + }, + { + "src": "images/icons/icon-152x152.png", + "sizes": "152x152", + "type": "image/png" + }, + { + "src": "images/icons/icon-196x196.png", + "sizes": "196x196", + "type": "image/png" + }, + { + "src": "images/icons/icon-256x256.png", + "sizes": "256x256", + "type": "image/png" + }, + { + "src": "images/icons/icon-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "permissions": ["unlimitedStorage"] +} diff --git a/src/index.ts b/src/index.ts index 7606e2f34..b31619f0d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,6 +12,7 @@ require('app-module-path').addPath(require('path').join(__dirname)) require('dotenv').config() import fetch from 'node-fetch' +import path from 'path' import * as Hapi from '@hapi/hapi' import * as Pino from 'hapi-pino' import * as JWT from 'hapi-auth-jwt2' @@ -541,6 +542,23 @@ export async function createServer() { } }) + server.route({ + method: 'GET', + path: '/static/{param*}', + handler: { + directory: { + path: path.join(__dirname, 'client-static'), + redirectToSlash: true, + index: false + } + }, + options: { + auth: false, + tags: ['api', 'static'], + description: 'Server static files for client' + } + }) + server.ext({ type: 'onRequest', method(request: Hapi.Request & { sentryScope?: any }, h) {