Merge pull request #3267 from strapi/tech/admin-build-cleanup

Admin build cleanup
This commit is contained in:
Jim LAURIE 2019-05-15 17:34:52 +02:00 committed by GitHub
commit 43d24e7198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 9 deletions

View File

@ -118,9 +118,8 @@ It's very common to deploy the front-end and the back-end on different servers.
"enabled": false
},
"admin": {
"path": "/dashboard",
"path": "/", // Note: The administration will be accessible from the root of the domain (ex: http//yourfrontend.com/)
"build": {
"host": "/", // Note: The administration will be accessible from the root of the domain (ex: http//yourfrontend.com/)
"backend": "http://yourbackend.com"
}
}
@ -146,8 +145,8 @@ In this case, we suppose that you decided to put your administration panel on a
"enabled": false
},
"admin": {
"path": "/dashboard",
"build": {
"host": "http://yourfrontend.com/dashboard", // Note: The custom path has moved directly in the host URL.
"backend": "http://yourbackend.com"
}
}

View File

@ -90,11 +90,7 @@ Object.keys(plugins).forEach(plugin => {
// TODO
const remoteURL = (() => {
if (window.location.port === '4000') {
return 'http://localhost:4000/admin';
}
// Relative URL (ex: /dashboard)
// Relative URL (ex: /dashboard)
if (REMOTE_URL[0] === '/') {
return (window.location.origin + REMOTE_URL).replace(/\/$/, '');
}

View File

@ -15,7 +15,7 @@ function createPluginsJs(plugins, dest) {
window.strapi = Object.assign(window.strapi || {}, {
node: MODE || 'host',
backendURL: BACKEND_URL,
backendURL: BACKEND_URL === '/' ? window.location.origin : BACKEND_URL,
languages,
currentLanguage:
window.localStorage.getItem('strapi-admin-language') ||