Merge pull request #360 from strapi/fix/refresh

Fix/refresh
This commit is contained in:
Aurélien GEORGET 2017-12-05 16:56:41 +01:00 committed by GitHub
commit 006d9f6f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -445,15 +445,15 @@
"policy": "" "policy": ""
}, },
"callback": { "callback": {
"enabled": true, "enabled": false,
"policy": "" "policy": ""
}, },
"register": { "register": {
"enabled": true, "enabled": false,
"policy": "" "policy": ""
}, },
"forgotPassword": { "forgotPassword": {
"enabled": true, "enabled": false,
"policy": "" "policy": ""
}, },
"changePassword": { "changePassword": {

View File

@ -81,6 +81,27 @@ module.exports = strapi => {
] ]
}); });
// Allow refresh in admin page.
strapi.router.route({
method: 'GET',
path: `${basename}/*`,
handler: [
async (ctx, next) => {
const parse = path.parse(ctx.url);
if (parse.ext === '') {
ctx.url = 'index.html';
}
await next();
},
strapi.koaMiddlewares.static(`./admin/admin/build`, {
maxage: strapi.config.middleware.settings.public.maxAge,
defer: true
})
]
});
// Serve admin assets. // Serve admin assets.
strapi.router.route({ strapi.router.route({
method: 'GET', method: 'GET',