Web api in electron.net #94

Closed
opened 2026-01-29 16:30:40 +00:00 by claunia · 3 comments
Owner

Originally created by @CD1010 on GitHub (Dec 16, 2017).

Originally assigned to: @GregorBiswanger on GitHub.

Is there a way to have angular 5 spa call a web api inside electron.net app? I want to avoid web round trip page refresh and use an existing .net codebase. No problem having .net lib emitting json

Originally created by @CD1010 on GitHub (Dec 16, 2017). Originally assigned to: @GregorBiswanger on GitHub. Is there a way to have angular 5 spa call a web api inside electron.net app? I want to avoid web round trip page refresh and use an existing .net codebase. No problem having .net lib emitting json
claunia added the question label 2026-01-29 16:30:40 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (Dec 18, 2017):

Yes, it is possible to call a web api inside the electron.net app. See the source code of a ASP.NET MVC Angular Project Sample Template (FetchDataComponent).. That works perfect in Electron.NET.. With this you´ll get the URL:

@Inject('BASE_URL') baseUrl: string

In C# you can use the default IP address 0.0.0.0. and for the used Port the static BridgeSettings.SocketPort-Method from the Electron.NET API.

Could I help you?

@GregorBiswanger commented on GitHub (Dec 18, 2017): Yes, it is possible to call a web api inside the electron.net app. See the source code of a ASP.NET MVC Angular Project Sample Template (FetchDataComponent).. That works perfect in Electron.NET.. With this you´ll get the URL: `@Inject('BASE_URL') baseUrl: string` In C# you can use the default IP address 0.0.0.0. and for the used Port the static BridgeSettings.SocketPort-Method from the Electron.NET API. Could I help you?
Author
Owner

@CD1010 commented on GitHub (Dec 19, 2017):

Thanks, i'll have to try that. Javascript communication through web api seems to me the way to go to bridge C# to javascript through json. I read other people using edge.js but sure how easy that is.

I'd be interested in any thoughts you have on the subject.

Awesome work on this, thanks.

@CD1010 commented on GitHub (Dec 19, 2017): Thanks, i'll have to try that. Javascript communication through web api seems to me the way to go to bridge C# to javascript through json. I read other people using edge.js but sure how easy that is. I'd be interested in any thoughts you have on the subject. Awesome work on this, thanks.
Author
Owner

@GregorBiswanger commented on GitHub (Dec 19, 2017):

The best way in Electron.NET is the internal IPC communication.

Please take a look into the Electron.NET API Demos App:
https://github.com/ElectronNET/electron.net-api-demos

@GregorBiswanger commented on GitHub (Dec 19, 2017): The best way in Electron.NET is the internal **IPC** communication. Please take a look into the **Electron.NET API Demos App**: https://github.com/ElectronNET/electron.net-api-demos
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#94