I would like to compile Vapor with my code as a MacOS app so I can place it on internal server (drag and click to launch it). I would prefer not to have to install Xcode, swift and other development files on the server. I am new to vapor and swift. I have things running when I build it from xCode. Someone else asked if they could embed it in app, there was yes and no response. The yes did not provide any direction as to how to do it. Can it be compiled to a standalone OSX App? What do I need to do to make it happen? Point me to docs if you know of any. I have compiled apps that are standalone. Just don't know how to do Vapor. Thanks
I think, initially at least, you have to install Xcode in order to build a vapor application, just to get the Swift stuff. Having done that, use terminal to change into the vapor project directory and then build and run the application using:
vapor update
vapor build
vapor run
This will result in an executable being created and run. The actual location depends whether you are compiling for debug or production (set in Config). Assuming you are still at the debug stage, the compiled executable can be run directly by typing:
.build/debug/Run
from your vapor project's home directory, instead of vapor run
. It won't run from elsewhere because it uses relative paths to Config, etc.
You could then copy the project tree and executable to another Mac and try installing the Swift runtime libraries, etc. to have it running without Xcode, etc.
Vapor is a web framework, you don't use it like a macOS app, but you need to deploy on your server together with a web server like Nginx.
https://medium.com/@ahmedraad/how-to-deploy-vapor-app-on-ubuntu-16-04-and-run-it-in-production-eef18f7b4f05
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With