PWA
This commit is contained in:
parent
18401ff0f0
commit
deed72709d
5 changed files with 34 additions and 2 deletions
|
@ -2,7 +2,7 @@ const verifyAuth = require('../middlewares/verifyAuth');
|
|||
const express = require('express');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = (db) => {
|
||||
module.exports = ({ db, config }) => {
|
||||
const router = express.Router();
|
||||
|
||||
router.use('/', express.static(path.join(__dirname, '../static')));
|
||||
|
@ -33,5 +33,7 @@ module.exports = (db) => {
|
|||
|
||||
router.use('/admin-settings', require('./adminSettings')(db));
|
||||
|
||||
router.use('/manifest.json', require('./manifest.json')({ config }))
|
||||
|
||||
return router;
|
||||
}
|
25
routes/manifest.json/index.js
Normal file
25
routes/manifest.json/index.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const express = require('express');
|
||||
|
||||
module.exports = ({ config }) => {
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', (req, res) => {
|
||||
res.send({
|
||||
name: config.siteTitle,
|
||||
short_name: config.shortTitle,
|
||||
background_color: 'white',
|
||||
description: 'Sleek Wishlist App',
|
||||
theme_color: '#dc5878',
|
||||
start_url: '/',
|
||||
display: 'standalone',
|
||||
icons: [
|
||||
{
|
||||
sizes: '1280x1280',
|
||||
src: '/img/logo.png'
|
||||
}
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
return router;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue