Solution 1 :

It is possible if you are on linux you have to make a bash script file that will run your app.js or index.js node file, for ex

node app.js

that will get executed when you press a button on page which again is easy if you use some server side language like php if you are interested here is the link for moreenter link description here

with just html its not possible easily its just too much of a task, just type that command in your terminal and you are good to go

rather you can make a script like bash in linux or bat in windows, that will open the server client side if you open that script file.

Problem :

Intro: Hello. So I started on a chat based social media app with, but it seems like the client needs to open a localhost server to be able to communicate with the socket manager on my web API (node, express,

Question Tree: Is it possible to make a nodejs server client side and execute a script with an html front end button so that the socket has a localhost to run tcp on to communicate to my web API? If so, how can I do this? If not, what are some alternatives to achieve the same results?

conclusion: Any help is appreciated, I am learning how to do this sort of development for school and I just want some clarity. Thank you!


Comment posted by deceze

Why not open a web socket connection from the JavaScript in your HTML page to your server? It’s unclear why you think you need a separate local server in addition…