{"id":15873596,"url":"https://github.com/tombuildsstuff/vapor-deploy-demo","last_synced_at":"2025-04-01T22:28:24.501Z","repository":{"id":142076208,"uuid":"68039514","full_name":"tombuildsstuff/vapor-deploy-demo","owner":"tombuildsstuff","description":null,"archived":false,"fork":false,"pushed_at":"2016-09-12T19:15:38.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T14:45:36.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tombuildsstuff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-12T19:13:42.000Z","updated_at":"2016-09-12T19:14:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"7db43d52-d08c-4830-ba75-5bf3170e2c92","html_url":"https://github.com/tombuildsstuff/vapor-deploy-demo","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"34fef1acf0384371be34b741d380d5131a480107"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Fvapor-deploy-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Fvapor-deploy-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Fvapor-deploy-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombuildsstuff%2Fvapor-deploy-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tombuildsstuff","download_url":"https://codeload.github.com/tombuildsstuff/vapor-deploy-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246720128,"owners_count":20822852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T01:04:34.785Z","updated_at":"2025-04-01T22:28:24.486Z","avatar_url":"https://github.com/tombuildsstuff.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vapor Example\n\nFork this example project as a boilerplate for working with Vapor.\n\nCheck out the [live demo](http://example.qutheory.io) running on Ubuntu.\n\n## Badges\n[![Build Status](https://img.shields.io/travis/qutheory/vapor-example.svg?style=flat-square)](https://travis-ci.org/qutheory/vapor-example)\n[![PRs Welcome](https://img.shields.io/badge/prs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![Slack Status](http://slack.qutheory.io/badge.svg?style=flat-square)](http://slack.qutheory.io)\n\n## Deploy\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n## Documentation\n\nView [Vapor](https://github.com/qutheory/vapor) for documentation.\n\n## Requirements\n\nSwift 3.0 preview 2 is required (Xcode 8 beta 2 on macOS). \n\nWorks on Ubuntu, Docker, Heroku, macOS.\n\nRun the following script to check if you have Swift 3.0 beta 2 properly installed and configured.\n\n```\ncurl -sL check.qutheory.io | bash\n```\n\n## Building\n\nVisit [Getting Started](http://docs.qutheory.io) in the documentation.\n\n### Compiling\n\nIf you have the [Vapor Toolbox](https://github.com/qutheory/vapor-toolbox), use `vapor new \u003cproject-name\u003e` to create your new application.\n\nThen run `vapor build` and `vapor run`.\n\nOtherwise, clone this repo and run `swift build` to compile your application, then run `.build/debug/App`.\n\n### Xcode 8\n\nRun `vapor xcode` which will create the Xcode Project and open Xcode 8.\n\n![Xcode](https://cloud.githubusercontent.com/assets/1342803/15592631/3e740df8-2373-11e6-8624-3c89260322aa.png)\n\n## Deploying\n\nCheck the [Vapor](https://github.com/qutheory/vapor) documentation for more in-depth deployment instructions.\n\n### Upstart\n\nTo start your `Vapor` site automatically when the server is booted, add this file to your server.\n\nYou can check if Upstart is installed with \n\n```sh\ninitctl --version\n```\n\nYou may need to install Upstart if it is not already on your installation of Linux.\n\n```sh\nsudo apt-get install upstart\n```\n\n`/etc/init/vapor-example.conf`\n\n```conf\ndescription \"Vapor Example\"\n\nstart on startup\n\nenv PORT=8080\n\nexec /home/\u003cuser_name\u003e/vapor-example/.build/release/App --env=production\n```\n\nYou additionally have access to the following commands for starting and stopping your server.\n\n```shell\nsudo stop vapor-example\nsudo start vapor-example\n```\n\nThe following script is useful for upgrading your website.\n\n```shell\ngit pull\nswift build --configuration release\nsudo stop vapor-example\nsudo start vapor-example\n```\n\n### Heroku\n\nUse the `vapor heroku` commands in the Vapor Toolbox to push to Heroku.\n\n### Docker\n\nYou can run this demo application locally in a Linux environment using Docker.\n\nMake sure you have installed the Vapor Toolbox.\n\n1. Ensure [Docker](https://www.docker.com) is installed on your local machine.\n2. Start the Docker terminal\n3. cd into `vapor-example`\n4. Create the Dockerfile `vapor docker init`\n5. Build the container `vapor docker build`\n6. Run the container `vapor docker run`\n7. Optionally enter the container `vapor docker enter`\n5. Configure VirtualBox to [forward ports 8080 to 8080](https://www.virtualbox.org/manual/ch06.html)\n6. Visit http://0.0.0.0:8080\n\n### Nginx / Supervisor\n\nYou can also run your Vapor app through Nginx.  It’s recommended you use [Supervisor](http://supervisord.org) to run the app instance to protect against crashes and ensure it’s always running.\n\n#### Supervisor\n\nTo setup Vapor running through Supervisor, follow these steps:\n\n`apt-get install -y supervisor`\n\nEdit the config below to match your environment and place it in `/etc/supervisor/conf.d/your-app.conf`:\n\n```shell\n[program:your-app]\ncommand=/path/to/app/.build/release/App serve --ip=127.0.0.1 --port=8080\ndirectory=/path/to/app\nuser=www-data\nstdout_logfile=/var/log/supervisor/%(program_name)-stdout.log\nstderr_logfile=/var/log/supervisor/%(program_name)-stderr.log\n```\n\nNow register the app with Supervisor and start it up:\n```shell\nsupervisorctl reread\nsupervisorctl add your-app\nsupervisorctl start your-app # `add` may have auto-started, so disregard an “already started” error here\n```\n\n#### Nginx\n\nWith the app now running via Supervisor, you can use this sample nginx config to proxy it through Nginx:\n\n```nginx\nserver {\n\tserver_name your.host;\n\tlisten 80;\n\n\troot /path/to/app/Public;\n\n\t# Serve all public/static files via nginx and then fallback to Vapor for the rest\n\ttry_files $uri @proxy;\n\n\tlocation @proxy {\n\t\t# Make sure the port here matches the port in your Supervisor config\n\t\tproxy_pass http://127.0.0.1:8080;\n\t\tproxy_pass_header Server;\n\t\tproxy_set_header Host $host;\n\t\tproxy_set_header X-Real-IP $remote_addr;\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\t\tproxy_connect_timeout 3s;\n\t\tproxy_read_timeout 10s;\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombuildsstuff%2Fvapor-deploy-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftombuildsstuff%2Fvapor-deploy-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombuildsstuff%2Fvapor-deploy-demo/lists"}