10 ways to deploy a React app for free

If you’re looking for an intro on how to deploy your React app to Vercel, Firebase, Netlify, GitHub Pages, Heroku, etc. this page has got you covered. Comes with easy to follow instructions.

10 ways to deploy a React app for free →

Deploying Your Ionic App to Heroku

Not much to it actually, as you only need Express to serve your Ionic app:

// server.js, Heroku will autostart this when found
var express = require('express'),
app = express();
app.use(express.static('www'));
app.set('port', process.env.PORT || 5000);
app.listen(app.get('port'), function () {
    console.log('Express server listening on port ' + app.get('port'));
});

Deploying Your Ionic App to Heroku →

Heroku <3 PHP

Good news from Heroku: PHP is (finally) properly supported. Just add a composer.json file to your repo and Heroku will know your app runs PHP. Yes, you see that right: Composer is supported. Whenever you push your code to Heroku, it will install the dependencies if needed.

$ git add .
$ git commit -m "Add basic logging"
[master 4b42543] Add basic logging
 1 file changed, 14 insertions(+), 1 deletion(-)
$ git push heroku master
Fetching repository, done.
Counting objects: 15, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (12/12), 2.39 KiB | 0 bytes/s, done.
Total 12 (delta 3), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> PHP app detected
-----> Setting up runtime environment...
       - PHP 5.5.11
       - Apache 2.4.9
       - Nginx 1.4.6
-----> Installing dependencies...
       Composer version 1e4df0690a08c4653b5c932d51a337b10d6c19bf 2014-04-10 19:10:45
       Loading composer repositories with package information
       Installing dependencies from lock file
         - Installing psr/log (1.0.0)
           Downloading: 100%

         - Installing monolog/monolog (1.8.0)
           Downloading: 100%

       Generating optimized autoload files
-----> Building runtime environment...
       Loading composer repositories with package information
       Updating dependencies
         - Installing heroku/heroku-buildpack-php (dev-beta 20204c9)
           Loading from cache

       Writing lock file
       Generating optimized autoload files
-----> Discovering process types
       Procfile declares types -> web

-----> Compressing... done, 60.8MB
-----> Launching... done, v6
       http://polar-chamber-3014.herokuapp.com/ deployed to Heroku

To git@heroku.com:polar-chamber-3014.git
   bd24c74..4b42543  master -> master

Heroku PHP Support →
Getting Started with PHP on Heroku →

Related: TokenPhrase, a PHP class which generates unique phrases – comparable to Heroku’s generated hostnames – for you to use in your app as tokens