39 lines
997 B
Markdown
39 lines
997 B
Markdown
# SIMEN backend example
|
|
|
|
## Getting Started
|
|
|
|
Install [composer](https://getcomposer.org/) in your path, then clone the repository
|
|
|
|
```bash
|
|
$ git clone http://gogs.ragnarok.yvan.hu/SIMEN/simen-backend-zf3mw.git simen-backend
|
|
```
|
|
|
|
Install the dependencies
|
|
|
|
```bash
|
|
$ composer install
|
|
```
|
|
|
|
Set up your webserver to point to the public folder of the project
|
|
|
|
Create a copy of the default doctrine configuration template:
|
|
```bash
|
|
$ cp config/autoload/doctrine.local.dist.php config/autoload/doctrine.local.php
|
|
```
|
|
|
|
Edit `doctrine.local.php` and set up your database connection.
|
|
|
|
> You can do the same with `errorhandler.local.dist.php` if you want to set up a fancy error handler
|
|
|
|
In development you can install the initial database with
|
|
```bash
|
|
$ vendor/bin/doctrine orm:schema-tool:create
|
|
```
|
|
|
|
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
|