Eel icon indicating copy to clipboard operation
Eel copied to clipboard

Is it possible to use Eel as a replacement/wrapper for REST API?

Open weathon opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. I find out calling eel between front end and back end is much easier than doing Rest for small projects.

Describe the solution you'd like Is it possible to use Eel for B/S set up instead of local?

weathon avatar Oct 02 '22 23:10 weathon

Hi @weathon, thanks for the question!

Is it possible to use Eel for B/S set up instead of local?

I'm not sure what this means... could you please elaborate? I don't know what B/S means in this context.

dstricks avatar Oct 08 '22 16:10 dstricks

Hi @weathon, thanks for the question!

Is it possible to use Eel for B/S set up instead of local?

I'm not sure what this means... could you please elaborate? I don't know what B/S means in this context.

Hi @dstricks

So I think eel is a good alternative to REST API, where I can call the backend function as a function in JS instead of constructing an ajax request. But now the intended usage of eel is local setup. Is it possible to make it just as a normal website where I can call the python backend (on a server) from the user browser? The B/S here means Browser/Server.

weathon avatar Oct 08 '22 19:10 weathon

Hello @weathon

I have done this sort of thing. Using an Eel python function to read a file on the local system and then send the data to the browser/the served Eel html/JavaScript, I then call the python from JavaScript in the browser. You would just have to add functions for any CRUD functions you wanted. E.g. a read function that runs an SQL Query on an SQL Lite data maybe? And if you started Eel with the browser disabled then you could have Eel run "Headless", again not sure why your want that. This is for a locally served "app" with one user making minimal requests for larger projects with multiple requests being processed Eel is probably not the best solution there are better REST API Libraries/frameworks. You could get it to work but not sure why unless you have a use case which Eel probably already fills.

doug-benn avatar Nov 09 '22 19:11 doug-benn