This repository has the basic setup for deploying static sites to Heroku using Dropbox.
See demo at https://github.com/javiercejudo/heroku-static-setup-demo.
Requirements:
To deploy your static site:
- Login to Heroku and create a new app.
- Connect the app to Dropbox. This will create a new folder under
Dropbox/Apps/Heroku/
with the name of your app. Learn more. - Copy your static site inside a folder named
public/
into the app's folder. - Download the latest version of the heroku-static-setup and extract the files into the app's folder. At this point, you should have the following:
Dropbox/
`-- Apps/
`-- Heroku/
`-- app-name/
|-- public/
| |-- [Your static files]
| `-- ...
|-- package.json
|-- index.js
`-- Procfile
- Wait until Dropbox has synchronised all the files and deploy from the Heroku interface.
- When the build is finished, you should be able to see your site at
https://[app-name].herokuapp.com
.
- Simple workflow without Git, the Heroku Toolbet or even the command line.
- Gzip compression out of the box.
package.json
: defines the NPM dependencies.index.js
: defines the app, the path to your static site (public/
by default) and the port (5000 by default).Procfile
: tells Heroku how to start the server.
- Install Node.js.
- Run
npm install
from theapp-name/
folder where thepackage.json
lives. - Run
npm start
and visit http://localhost:5000
To start the app on a different port, run PORT=[your port] npm start
.