Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/lib/node_modules/wonlog/dist/wonlog/bin/ drwxr-xr-x | |
| Viewing file: Select action/file-type: #!/usr/bin/env node
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const yargs_parser_1 = __importDefault(require("yargs-parser"));
require("wonlog-server");
const express_1 = __importDefault(require("express"));
const path_1 = __importDefault(require("path"));
const fs_1 = __importDefault(require("fs"));
const DEFAULT_PORT = 7979;
const DEFAULT_SERVER_HOST = '0.0.0.0';
const DEFAULT_URL_HOST = '127.0.0.1';
// The code below in the comment is in packages/wonlog-server/src/application.ts
// .option('--webapp-host [host]', 'WebApp Server host', '0.0.0.0') // This is used in /packages/wonlog in the release build. TODO. find a better way.
// .option('--webapp-port [port]', 'WebApp Server port', '7979'); // This is used in /packages/wonlog in the release build. TODO. find a better way.
const options = (0, yargs_parser_1.default)(process.argv);
const WEBAPP_BASE_PATH = process.env.NODE_ENV !== 'development' ? '../../' : '../../dist';
const app = (0, express_1.default)();
app.get('/', function (req, res) {
const buffer = fs_1.default.readFileSync(path_1.default.join(__dirname, WEBAPP_BASE_PATH, 'webapp', 'index.html'), { flag: 'r' });
const html = buffer
.toString()
.replace('%%WONLOG_RELEASE_WEBSOCKET_URL%%', `ws://${options['http-host'] || '127.0.0.1'}:${options['http-port'] || 7978}`);
res.set('Content-Type', 'text/html');
res.send(html);
});
app.use(express_1.default.static(path_1.default.join(__dirname, WEBAPP_BASE_PATH, 'webapp')));
app.listen(options['webapp-port'] || DEFAULT_PORT, options['webapp-host'] || DEFAULT_SERVER_HOST, () => {
console.log(' Open your browser and go to http://%s:%d', options['webapp-host'] || DEFAULT_URL_HOST, options['webapp-port'] || DEFAULT_PORT);
});
//# sourceMappingURL=wonlog-server.js.map |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0037 ]-- |