Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help understanding what and how you've done this #28

Open
MtnBiker opened this issue Oct 30, 2021 · 1 comment
Open

Help understanding what and how you've done this #28

MtnBiker opened this issue Oct 30, 2021 · 1 comment

Comments

@MtnBiker
Copy link

If I get this, you've made a Rails app run as an Electron app.

How?

And can this then be converted to an app that would just run instead of needing yarn start?

@morochena
Copy link
Owner

Sure, in main.js:

const railsApp = require('child_process').spawn('rails', ['s'])

You can see that I'm starting a child process that runs the rails server.

mainWindow.loadURL('http://localhost:3000')

And then here you can see that I'm loading that URL in the main window.

Packaging it would be more difficult - you would need to be able to run rails on the target system. It may make sense to use docker or even another web framework where you can package the web application as a single executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants