feat: sync mixly static resources, tools and sw-mixly
This commit is contained in:
31
mixly/static-server/server.js
Normal file
31
mixly/static-server/server.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const fs = require('fs')
|
||||
const StaticServer = require('./static-server.js');
|
||||
const SSLStaticServer = require('./static-sslserver.js');
|
||||
|
||||
|
||||
function deleteFile(filePath) {
|
||||
try {
|
||||
if (!fs.existsSync(filePath)) {
|
||||
return;
|
||||
}
|
||||
const stats = fs.statSync(filePath);
|
||||
if (stats.isFile()) {
|
||||
fs.unlinkSync(filePath);
|
||||
console.log('File deleted successfully.');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error deleting file:', err);
|
||||
}
|
||||
}
|
||||
|
||||
const init = () => {
|
||||
StaticServer.run('7000');
|
||||
SSLStaticServer.run('8000');
|
||||
}
|
||||
|
||||
if (!module.parent) {
|
||||
deleteFile('./nw_cache/Default/Preferences');
|
||||
init();
|
||||
} else {
|
||||
module.exports = init;
|
||||
}
|
||||
Reference in New Issue
Block a user