39 lines
997 B
Markdown
Raw Normal View History

# SIMEN backend example
2016-07-31 20:47:25 +02:00
## Getting Started
Install [composer](https://getcomposer.org/) in your path, then clone the repository
2016-07-31 20:47:25 +02:00
```bash
$ git clone http://gogs.ragnarok.yvan.hu/SIMEN/simen-backend-zf3mw.git simen-backend
2016-07-31 20:47:25 +02:00
```
Install the dependencies
2016-07-31 20:47:25 +02:00
```bash
$ composer install
2016-07-31 20:47:25 +02:00
```
Set up your webserver to point to the public folder of the project
2016-07-31 20:47:25 +02:00
Create a copy of the default doctrine configuration template:
```bash
$ cp config/autoload/doctrine.local.dist.php config/autoload/doctrine.local.php
```
2016-07-31 20:47:25 +02:00
Edit `doctrine.local.php` and set up your database connection.
2016-07-31 20:47:25 +02:00
> You can do the same with `errorhandler.local.dist.php` if you want to set up a fancy error handler
2016-07-31 20:47:25 +02:00
In development you can install the initial database with
2016-07-31 20:47:25 +02:00
```bash
$ vendor/bin/doctrine orm:schema-tool:create
2016-07-31 20:47:25 +02:00
```
API endpoints are:
* list all: HTTP GET /api/article
* get one: HTTP GET /api/article/:id
* insert: HTTP POST /api/article
* update: HTTP PUT /api/article/:id
* delete: HTTP DELETE /api/article/:id