Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle with server side languages #151

Closed
flip111 opened this issue Mar 19, 2019 · 7 comments
Closed

Bundle with server side languages #151

flip111 opened this issue Mar 19, 2019 · 7 comments
Labels
question Further information is requested

Comments

@flip111
Copy link

flip111 commented Mar 19, 2019

neutralinojs comes with a C++ server. It's not clear to me what exactly is the server side doing. But i was wondering if it's possible to bundle neutralinojs with languages such as php, ruby, python and haskell and possibly some databases or other tools.

With electron i saw a view examples around such as this one https://codetalk.io/posts/2016-05-11-using-electron-with-haskell.html

@shalithasuranga
Copy link
Member

c++ server of neutralinojs is handling all backend calls such as filesystem access. terminal access etc (See docs for more).

The article you mentioned explains how electron app connects with a server which is written with Haskell. Also, that task is possible with neutralinojs too. So you can use os.runCommand to start the server and maybe JQuery to communicate with the server.

@shalithasuranga shalithasuranga added the question Further information is requested label Mar 21, 2019
@flip111
Copy link
Author

flip111 commented Mar 21, 2019

Aah that's pretty great. Would be good to put that in a FAQ of some sorts :)

To which server would jQuery have to connect to? Some port on localhost? What if there are problems with the server like port already being in use?

@shalithasuranga
Copy link
Member

Yeah! this can be added to documentation. thanks!

Neutralino usually uses a random port for its server. So no need to know about that :) . But in this case there is another custom server. So, you can decide which port you are going to use

@telamon
Copy link

telamon commented Aug 20, 2019

@shalithasuranga Actually i recently tried the custom server approach. But i always ended up with a network error when i tried to communicate with my custom local backend, thus I assumed that it was not possible to make arbitrary requests.

But reading this issue maybe my assumptions are wrong? I couldn't find any tests or proof anywhere that this approach is supposed to work.

@kasvith
Copy link
Contributor

kasvith commented Sep 15, 2019

This can be done for sure, we can explicitly disable default API server and allow connecting to any backend as mentioned in the electron article

@telamon
Copy link

telamon commented Sep 15, 2019

@kasvith I can confirm that it works, the connection error i had was my own fault due to having once again accidentally confused which server should serve up the CORS header. Once a valid CORS header was added to my custom backend everything worked gloriously.

@shalithasuranga
Copy link
Member

Hey.. I am closing this issue because the question has been answered already..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants