Skip to content

Commit

Permalink
Serve client manifest and icons from country-config
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq89 committed Aug 16, 2024
1 parent 9913fad commit 9b716bb
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 0 deletions.
Binary file added src/client-static/images/icons/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client-static/images/icons/icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client-static/images/icons/icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client-static/images/icons/icon-196x196.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client-static/images/icons/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client-static/images/icons/icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/client-static/images/logo-90x90.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/client-static/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "OpenCRVS",
"short_name": "OpenCRVS",
"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"]
}
18 changes: 18 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -529,6 +530,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) {
Expand Down

0 comments on commit 9b716bb

Please sign in to comment.