Skip to content

Commit

Permalink
Move the PHP dev server info to a separate README file
Browse files Browse the repository at this point in the history
  • Loading branch information
akrabat committed Feb 24, 2015
1 parent 3988714 commit 4c88b5a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
26 changes: 26 additions & 0 deletions README-local-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Quick start with the PHP dev server

The API will run happily under the [PHP development server](http://php.net/manual/en/features.commandline.webserver.php). You will need to have a MySQL running with the Joind.in schema availble, referenced from the src/database.php file (see below about initialising the DB). Note that the web2 site will also run under the built-in webserver, but will need to be on a different listening port.

To run the API on http://localhost:8080/, do the following:
```
cd src/public
export JOINDIN_API_BASE_URL=http://localhost:8081
php -S localhost:8081 index.php
```

## Initialising the database

As you are not using the Vagrant setup, you will need to provide your own MySQL database and configure it in src/database.php. Once there is an empty database and a username/password, you can setup the tables by running the patch script at scripts/patchdb.sh with the "-i" (initialise DB) option.

```
cd scripts
./patchdb.sh -t ../ -d <DB name> -u <DB username> -p <DB password> -i
```

If you already have a development DB, but you want to patch it up to the latest structure, then run the same command except omit the "-i" option.

```
cd scripts
./patchdb.sh -t ../ -d <DB name> -u <DB username> -p <DB password>
```
29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,12 @@ To get you going without much hassle we created a vagrant-setup. To use it [fork

This VM will load all three Joind.in projects (joind.in, joindin-vm and joindin-web2).

## Quick start with the PHP dev server

The API will run happily under the [PHP development server](http://php.net/manual/en/features.commandline.webserver.php). You will need to have a MySQL running with the Joind.in schema availble, referenced from the src/database.php file (see below about initialising the DB). Note that the web2 site will also run under the built-in webserver, but will need to be on a different listening port.

To run the API on http://localhost:8080/, do the following:
```
cd src/public
export JOINDIN_API_BASE_URL=http://localhost:8081
php -S localhost:8081 index.php
```

## How to use the API

Go to http://api.joind.in and click around!

There's more documentation here: http://joindin.github.io/joindin-api/ - it's powered by the content of the ``gh-pages`` branch on this repo, patches very welcome there also!

## Initialising the database

If you are not using the [Vagrant](Quick start with Vagrant) setup, you will need to provide your own MySQL database and configure it in src/database.php. Once there is an empty database and a username/password, you can setup the tables by running the patch script at scripts/patchdb.sh with the "-i" (initialise DB) option.

```
cd scripts
./patchdb.sh -t ../ -d <DB name> -u <DB username> -p <DB password> -i
```

If you already have a development DB, but you want to patch it up to the latest structure, then run the same command except omit the "-i" option.

```
cd scripts
./patchdb.sh -t ../ -d <DB name> -u <DB username> -p <DB password>
```

## Tools and Tests

### API Tests
Expand All @@ -58,7 +31,7 @@ I also found that I needed:

You should set the URL that the tests run against to be your local installation:

export JOINDIN_API_BASE_URL=http://api.dev.joind.in:8080
export JOINDIN_API_BASE_URL=http://api.dev.joind.in

Then run the tests by going to `/tests/frisby` and running:

Expand Down

0 comments on commit 4c88b5a

Please sign in to comment.