Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron architecture API calls

Hello Stackoverflow Community,

I'm currently diving in into cross-platform apps with Electron. As I'm a newbie to this topic there are some uncertainties: In "normal" webdevelopment I would write an API in Go(lang) which processes JSON files. Is it possible to set up Electron like an offline server which can make API calls?

Thank you in advance. I really appreciate your help.

like image 238
alexfwulf Avatar asked Feb 23 '26 09:02

alexfwulf


1 Answers

Yes, it is possible and and here is a library go-astilectron that demonstrates this approach. You can read more in the article How to add a GUI to your Golang app in 5 easy steps (powered by Electron). It's based on this project astilectron - Electron app that provides an API over a TCP socket that allows executing Electron's method as well as capturing Electron's events.

like image 194
vitr Avatar answered Feb 26 '26 02:02

vitr