How to use the strapi-admin.watch function in strapi-admin

To help you get started, we’ve selected a few strapi-admin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strapi / strapi / packages / strapi / lib / commands / watch.js View on Github external
const envConfigDir = path.join(dir, 'config', 'environments', 'development');
  const serverConfig = await loadConfigFile(envConfigDir, 'server.+(js|json)');

  const port = _.get(serverConfig, 'port', 1337);
  const host = _.get(serverConfig, 'host', 'localhost');
  const adminPort = _.get(serverConfig, 'admin.port', 8000);
  const adminBackend = _.get(
    serverConfig,
    'admin.build.backend',
    `http://${host}:${port}`
  );
  const adminPath = _.get(serverConfig, 'admin.path', '/admin');

  watchFiles();
  strapiAdmin.watch({
    dir,
    port: adminPort,
    options: {
      backend: adminBackend,
      publicPath: addSlash(adminPath),
    },
  });
};

strapi-admin

Strapi Admin

SEE LICENSE IN LICENSE
Latest version published 1 year ago

Package Health Score

61 / 100
Full package analysis

Similar packages