Run Electron UI on different port - electron

Is there a way to run an Electron app's UI on a different port? I have an app server (Wildfly) running on port 8080 and when I start the Electron app the app server default page is shown within the Electron app window. I believe that Electron runs on port 8080 in the background. Is there a way to change that to i.e. port 9000?

An Electron app is basically a Chromium browser with NodeJS support which loads any file you want to display from disk. It does not start any server (neither HTTP nor anything else).
With "default app page" I believe you mean the index.html file of the electron-quick-start project. This file, for example, gets loaded in main.js, line 16 using Electron's BrowserWindow#loadFile (...) function. This basically behaves equivalently to loading it using #loadURL ("file:///...") or by using file:// in your browser to load any file from disk.

Related

How to serve a Bolero (F#) web app to the internet?

I'm new to using web servers, and I'm trying to learn the Bolero (F#) web framework. As a learning exercise, I'm trying to put the example app "into production", i.e. serve it to the internet and not just localhost.
I would like to use a basic (linux) web server to serve the website (specifically DigitalOcean)..i.e. not a specialized dotnet/microsoft/azure etc platform.
I don't believe that launching an app is covered in the documentation on the Bolero website (aside from a development setup using localhost).
I created the app with:
dotnet new bolero-app -o HelloWorld
Then after some web-searching I did:
cd HelloWorld
dotnet publish -c Release
Then if I do:
cd ./src/HelloWorld.Server/bin/Release/net6.0/publish
./HelloWorld.Server
I get the message:
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001
Application started. Press Ctrl+C to shut down.
I'm not sure if those steps are the way I should be going about this...I would like to be serving on port 80, but I've not been able to change that or find where this is set in the example project. I grepped the project for "5000" but couldn't find where that setting is. I tried setting an environment variable with: "sudo export ASPNETCORE_URLS=http://localhost:80/". That hasn't changed where the app tries to serve the site. (Presumably I should be trying to write the server's ip address there instead of localhost?)
Any help is appreciated! Thanks!
EDIT: I've been able to serve the app to the internet!
From the main app directory (HelloWorld) I did:
cd /src/HelloWorld.Server
sudo dotnet run --urls "http://xxx.xxx.xxx.xxx:80/
...where the x's were replaced with my server's IP address.
)

Cypress can't load assets from Vite's devserver

I have an app running at http://localhost/ which loads it's assets from a Vite's devserver which is up at http://localhost:3000/. Cypress is hitting the main app correctly, but it doesn't load the assets, leaving me with a blank page because the page received no response for the http://localhost:3000/app.js file.
Everything works fine if I visit the app directly on the browser. The browser is able to load the assets from port 3000 without problems. They're only failing when requested via the Cypress test runner.
I tried to cy.visit('http://localhost:3000/') and it seems like the Vite's devserver is refusing connections. But I checked the Vite documentation to see if there was something that could be blocking this and nothing caught my eyes. Also, the strange part is that they're only blocked when requested via the test runner.
I'm running Cypress on WSL2 and my app and the Vite devserver are running through Docker mapping to the addresses above. Is there any additional configuration I'm missing?
If I build the assets and serve them from the main app address (http://localhost/dist/app.js), everything works fine and my tests run fine. So, I'm guessing there's some sort of configuration I need to do to allow Cypress to request assets form other hosts?

Loopback Controller APIs not working inside electron app

I am trying to run a loopback based application inside by electron app. I was successful in configuring SQLite into loopback and also DB migration inside the app. The server runs fine inside electron in debug mode and I am able to access API endpoints that I created. But when I package the app and run the .app file, the server starts up fine but there are no API endpoints. Here is the link to code: https://github.com/sahilanguralla/daakiya

How WebStorm runs Dart web apps

When running a Dart web app in WebStorm, the "Pub Serve" tab on the ? pane at the bottom reports the following (--port differs from run to run):
/home/tom/dart-sdk/bin/pub serve web --port=46247
Loading source assets...
Loading polymer transformers...
Serving polymer_and_dart web on http://localhost:46247
However, the app will be accessible at http://localhost:63342.
Yet when I run pub serve from the command line, the app will be accessible at localhost:46247:
/home/tom/dart-sdk/bin/pub serve web --port=46247
Can someone explain what WebStorm is doing at the specified port, if it is not to serve the app?
BTW, I am using only Dartium in development.
WebStorm has an integrated proxy that listens on its own port and just forwards to the port pub serve is listening on.
pub serve will be removed in Dart 2.
Currently 4/2018 there is no integration of pub run build_runner serve with IntelliJ but it is work in progress.
Webstorm 2018.1 seems to do something a little different from a proxy. Webstorm runs a web server at the debug port that will respond with a 302 redirect when it receives a GET http://localhost:{{debugPort}}/web/web/{{targetPage}}. The redirect's Location header will refer to the actual location of the target page in the Dart web app.
If, by some chance you need to get the random port programmatically during development, you can enable "Allow unsigned requests" in the Webstorm debugger settings and then write some scaffolding code to get the Location header.

How to publish a JSP Webpage created with Netbeans?

I want to allow others to access my website created through Netbeans but I don't know how to do so. Ive searched and I found that you had to buy webservers and domain names?
However, I only want to host the webpage using my own computer since it isn't really anything commercial. How can I publish the webpage using Netbeans or my own computer? Would using IIS of Windows be possible?
Thanks!
You can download or use (if you have installed) Apache-Tomcat to deploy your web-app on your local machine.
Text from the above mentioned link.
It is possible to deploy web applications to a running Tomcat server.
If the Host autoDeploy attribute is "true", the Host will attempt to
deploy and update web applications dynamically, as needed, for example
if a new .WAR is dropped into the appBase. For this to work, the Host
needs to have background processing enabled which is the default
configuration.

Resources