mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 11:25:17 +00:00
Merge branch 'front/dz-post-data' of github.com:strapi/strapi into ctb/events
This commit is contained in:
commit
6c62e7c481
@ -25,6 +25,25 @@ By default, the administration panel is exposed via [http://localhost:1337/admin
|
||||
}
|
||||
```
|
||||
|
||||
## Change the host
|
||||
|
||||
By default, the administration panel client host name is `localhost`. However, you can change this setting by updating the `admin` configuration:
|
||||
|
||||
**Path —** `./config/environment/**/server.json`.
|
||||
|
||||
```json
|
||||
{
|
||||
"host": "localhost",
|
||||
"port": 1337,
|
||||
"cron": {
|
||||
"enabled": false
|
||||
},
|
||||
"admin": {
|
||||
"host": "my-host"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The panel will be available through [http://localhost:1337/dashboard](http://localhost:1337/dashboard) with the configurations above.
|
||||
|
||||
## Development mode
|
||||
@ -170,6 +189,25 @@ Add the following configuration:
|
||||
export const SHOW_TUTORIALS = false;
|
||||
```
|
||||
|
||||
### Changing the port
|
||||
|
||||
By default, the front-development server runs on the `8000` port. However, you can change this setting by updating the following configuration:
|
||||
|
||||
**Path —** `./config/environment/**/server.json`.
|
||||
|
||||
```json
|
||||
{
|
||||
"host": "localhost",
|
||||
"port": 1337,
|
||||
"cron": {
|
||||
"enabled": false
|
||||
},
|
||||
"admin": {
|
||||
"port": 3000
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Build
|
||||
|
||||
To build the administration, run the following command from the root directory of your project.
|
||||
|
||||
@ -199,7 +199,7 @@ async function build({ dir, env, options, optimize }) {
|
||||
});
|
||||
}
|
||||
|
||||
async function watchAdmin({ dir, port, options }) {
|
||||
async function watchAdmin({ dir, host, port, options }) {
|
||||
// Create the cache dir containing the front-end files.
|
||||
await createCacheDir(dir);
|
||||
|
||||
@ -228,7 +228,7 @@ async function watchAdmin({ dir, port, options }) {
|
||||
|
||||
const server = new WebpackDevServer(webpack(getWebpackConfig(args)), opts);
|
||||
|
||||
server.listen(port, 'localhost', function(err) {
|
||||
server.listen(port, host, function(err) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
@ -237,7 +237,7 @@ async function watchAdmin({ dir, port, options }) {
|
||||
console.log();
|
||||
console.log(
|
||||
chalk.green(
|
||||
`Admin development at http://localhost:${port}${opts.publicPath}`
|
||||
`Admin development at http://${host}:${port}${opts.publicPath}`
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
@ -14,6 +14,7 @@ module.exports = async function() {
|
||||
const port = _.get(serverConfig, 'port', 1337);
|
||||
const host = _.get(serverConfig, 'host', 'localhost');
|
||||
const adminPort = _.get(serverConfig, 'admin.port', 8000);
|
||||
const adminHost = _.get(serverConfig, 'admin.host', 'localhost');
|
||||
const adminBackend = _.get(
|
||||
serverConfig,
|
||||
'admin.build.backend',
|
||||
@ -24,6 +25,7 @@ module.exports = async function() {
|
||||
strapiAdmin.watchAdmin({
|
||||
dir,
|
||||
port: adminPort,
|
||||
host: adminHost,
|
||||
options: {
|
||||
backend: adminBackend,
|
||||
publicPath: addSlash(adminPath),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user