mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Web api in electron.net #94
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@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: stringIn 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?
@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.
@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