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

Deploying section out of date #85

Open
sdhull opened this issue Nov 26, 2018 · 1 comment
Open

Deploying section out of date #85

sdhull opened this issue Nov 26, 2018 · 1 comment

Comments

@sdhull
Copy link
Contributor

sdhull commented Nov 26, 2018

And has said it will be updated "soon" for probably a year or more? Even just removing most of that page and linking to Fastboot App Server repo would be an improvement.

However there's also an opportunity here to iron out some confusion about the difference between ember-cli-fastboot & fastboot-app-server, since I think people are frequently confused about this.

There's also an opportunity to create a generic Fasboot App Server that can be deployed to Heroku and configured with environment variables. IMO this is sorely needed and pretty low-hanging fruit. My company had one briefly but we have added some proprietary customizations & are no longer comfortable keeping it open source. However we could probably keep an older, generic version open source if that's helpful.

@sdhull
Copy link
Contributor Author

sdhull commented Nov 29, 2018

So for this one I think we should add a reference app for users to deploy to heroku. I suggest we add a repo to the ember-fastboot org, maybe call it heroku-fastboot-server

// server.js
const FastBootAppServer = require('fastboot-app-server');
const S3Downloader = require('fastboot-s3-downloader');
const S3Notifier = require('fastboot-s3-notifier');

let downloader = new S3Downloader({
  bucket: process.env.S3_BUCKET,
  accessKeyId: process.env.AWS_KEY,
  secretAccessKey: process.env.AWS_SECRET,
  region: 'us-east-1',
  key: 'fastboot-deploy-info.json'
});

let notifier = new S3Notifier({
  bucket: process.env.S3_BUCKET,
  accessKeyId: process.env.AWS_KEY,
  secretAccessKey: process.env.AWS_SECRET,
  region: 'us-east-1',
  key: 'fastboot-deploy-info.json'
});

let server = new FastBootAppServer({
  downloader,
  notifier,
  gzip: true,

  beforeMiddleware(app) {
    app.use((request, response, next) => {
      if (request.headers['x-forwarded-proto'] === 'https') {
        return next();
      } else {
        return response.redirect(301, `https://${request.hostname}${request.url}`);
      }
    });
  }
});

server.start()

And

// Procfile
web: node server.js

Maybe a Readme:

A super simple app intended to run an Ember Fastboot app on Heroku. Deploy it once and just forget about it.

This assumes you have previously built your ember app using ember-cli-deploy-fastboot-app-server and ember-cli-deploy-fastboot-app-server-aws.

heroku config:set S3_BUCKET=your_bucket AWS_KEY=your_key AWS_SECRET=your_secret
git push heroku master
cd your/ember/app && ember deploy

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

1 participant