This is a boilerplate setup to get going quickly with a PHP microservice. We provided a few things for you:
- Front controller
index.php
is the main route into your application. Every HTTP request arrives here. You can define your routes and controllers here, or you can restructure everything if you want to go more advanced. The web library we're using is really flexible and puts you in control. - Silex is included as web library, all documentation can be found on the Silex homepage.
- Namespace
Poker
will be autoloaded from thesrc/
directory. Just create the directory and get going if you want to use it.
- Clone this repo
- Create an account on Fortrabbit
- Create a new application inside your fortrabbit account.
- Copy your public key
cat ~/.ssh/id_rsa.pub | pbcopy
- Add it to your Fortrabbit application under "ssh access"
- Copy the git url that Fortrabbit gives you
- Add that url as a remote to your local repository
git remote add fortrabbit <url>
. Don't forget to replace<url>
with the real url you copied in step 4. - Deploying is as easy as pushing to that remote:
git push fortrabbit master
- Visit your fortrabbit app's URL to see your microservice working!