Express Backend #1177
Replies: 5 comments 1 reply
-
In short, the answer is no. Express uses routes and feeds pages to the browser. Neu by nature just feeds the file in the Also, it will not be localhost safe even if we used the routes by express. A feature request can be to change the |
Beta Was this translation helpful? Give feedback.
-
It is possible to start an Express server as a packaged executable using the execCommand() API. eg: I use Caxa to bundle node with an Express server and the bundle ends up being c. 30M. The server can be set for localhost and whatever port and webroot. I haven't quite conquered the sqlite side of things but have been trying the execCommand method and also the Extension method (Discussion #737 and Issues #795). I think using the Extensions is possibly the best avenue for a database but I haven't yet managed to get an sqlite scenario working. |
Beta Was this translation helpful? Give feedback.
-
@Blatman yeah it is possible to use Express that way. However, that Express will act as a server, and it cannot be integrated with Neutralino since they work in different ways: You are right, Extensions can be the possible route. I'm no SQLite professional, but if you can get SQLite to work in a normal NodeJS file (or python file), then it'll be a matter of hooking up the extensions to work in that file, using Neu's extensions API. |
Beta Was this translation helpful? Give feedback.
-
I've been doing something similar. I start my server as an extension of the neutralino app. The neutralino static server serves static files while my own server handles normal CRUD requests. Of course it would be better if the two web servers could be integrated into one, but the extension approach is enough for the moment. Just make sure you handle the CORS issue corretly in your own server because requests from the front end will be treated as cross-origin requests by your own server. |
Beta Was this translation helpful? Give feedback.
-
Thanks guys for your assistance. Please can you hack up a sample code to
demonstrate this process for me? I will appreciate it so much. Thanks once
again.
…On Wed, 25 May 2022 at 06:30, pkulijing ***@***.***> wrote:
I've been doing something similar. I start my server as an extension of
the neutralino app. The neutralino static server serves static files while
my own server handles normal CRUD requests. Of course it would be better if
the two web servers could be integrated into one, but the extension
approach is enough for the moment. Just make sure you handle the CORS issue
corretly in your own server because requests from the front end will be
treated as cross-origin requests by your own server.
—
Reply to this email directly, view it on GitHub
<#899 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOZ24WW6C2PI3RK6Y75VFQTVLXCIXANCNFSM5WMTDWDA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Is it possible to hook up an express server to a NEU app?
This is my stack:
Vue JS for the front end and Express for the backend. I also am using SQLite for my database.
I am confused as to how to piece all these together to make a desktop app with success.
Any pointers, sample code and help will be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions