Free web application framework for building Web sites and Web applications using JavaScript, HTML and CSS. Node.js (MVC) web application framework.
Hi, what's the problem? I think that your Nginx config doesn't contain correct settings for websocket, example:
server {
listen 80;
server_name totaljs.com;
server_name www.totaljs.com;
charset utf-8;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://0.0.0.0:8000;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
break;
}
}
I recommend to install SuperAdmin
on your server and the install Messenger via SuperAdmin.
Hi @lancedouglas1, thank you.
Do you have documentation on properly hosting it in scalable serverless architecture with a centralized nosql?
Good question. We offer Cloud services, but not auto-scalable for some Total.js app - for this case we're preparing Total.js Threads cloud hosting - https://docs.totaljs.com/latest/en.html#pages~Threads ... Flow isn't scalable, but we have prepared something special for Flow too.
process.getuid
is not available on Windows. https://nodejs.org/api/process.html#process_process_getuid
@petersirka @molda Hello, I was trying to run batch file from backend on apply button. So I tried following code in index.html-
function executeAfterApply(){
alert('Apply button clicked' );
//WshShell = new ActiveXObject("Wscript.Shell");
//WshShell.run("d://temp/batchfile.bat");
const { exec } = require("child_process");
exec("d:/temp/batchfile.bat", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});
};
( I refer this code from following link):- https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
But, I am getting this error :-
default.js:50 Uncaught ReferenceError: require is not defined
at executeAfterApply (default.js:50)
at Zt.callback ((index):1)
at Zt.self.hide (default.js:59)
at HTMLButtonElement.<anonymous> (default.js:59)
at HTMLDivElement.dispatch (default.js:38)
at HTMLDivElement.y.handle (default.js:38)
require
is Node.js specific(only works on the server) so it won't work in the browser.d:/temp/batchfile.bat
is on the client side you would need to upload it to the server first. BUT that's a really BAD idea to allow poeple to upload executable script on your server and let them run it.
FLOW.set(key, value)
and FLOW.get(key)
It's in the documentation --> https://github.com/totaljs/flow#flow
Hi,
@petersirka @molda I have 2 Queries.
1] In Total Js FLow there is play and pause button. What is actual use of it ? Can I use That button for trigger my flow( Means instead of using trigger component in flow can I replace its functionality with play-pause button).
2] And As we know FLOW is global . I can access it any component. But what if I want to use it in html(Means in export.html inside script tag)Is that thing possible ??
@aniketwagh17
1. In Total Js FLow there is play and pause button
It pauses the entire Flow, so all inputs will be disabled.
2. And As we know FLOW is global
You can access it from server-side code only. So you can use global on client-side (for this case you need to send some values from globals via TRIGGER - only in settings section).
3. I want to trigger my code without using trigger component instead of that I want to control it using play/pause button(nearby Apply button)
I recommend to create some custom empty HTML page where will be a button called e.g. TRIGGER. If the user clicks on the button then you need to send a request to server and executes some Flow component manually - it's easy.
BTW: we don't use Gitter. Ianswer on platform.totaljs.com or on Telegram https://t.me/totaljs