Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await fs.move(siteSrcPath, snapshotFolder);
await fs.emptyDir(siteSrcPath);
}
let localSite, editorServer, adminServer;
const closeAll = () =>
Promise.all([
Promise.resolve(localSite && localSite.close()),
Promise.resolve(editorServer && editorServer.close()),
Promise.resolve(adminServer && adminServer.close())
]);
try {
localSite = await initLocalSiteManager(siteSrcPath, siteBackupPath);
editorServer = await startSocketServer(DEFAULT_EDITOR_PORT, {
allowedDomains: ["editor.wix.com"].concat(
process.env.NODE_ENV === "test" ? ["localhost"] : []
)
});
adminServer = await startSocketServer(DEFAULT_ADMIN_PORT);
adminServer.io.use(adminTokenMiddleware(adminToken));
initServerApi(localSite, adminServer, editorServer, !isEdit(options));
logger.info(
getMessage("Server_Listening_Log", {
editorPort: editorServer.port,
adminPort: adminServer.port
})