Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/notaphplover/tea-rest
Tea REST API experiment
https://github.com/notaphplover/tea-rest
Last synced: 2 days ago
JSON representation
Tea REST API experiment
- Host: GitHub
- URL: https://github.com/notaphplover/tea-rest
- Owner: notaphplover
- License: apache-2.0
- Created: 2019-11-20T23:16:48.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2020-09-02T21:19:57.000Z (over 4 years ago)
- Last Synced: 2024-11-17T20:48:25.020Z (2 months ago)
- Language: PHP
- Size: 479 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## TEA Rest Project
Restfull API build on top of Symfony.
### How to set up the project?
1. Clone the repo:
```
git clone https://github.com/notaphplover/tea-rest.git
```2. Go to the root folder of the project and install composer dependencies:
```
cd tea-rest
composer install
```__Still dont have Composer?__ [Download](https://getcomposer.org/download/) it now.
3. Set up env variables in the .env file:
- Set the database connection. __This connection must be a MySql DB server connection__.
At the end, our .env file should look like this:
```
APP_ENV=dev
APP_SECRET=MY_APP_SECRETDATABASE_URL=mysql://:@:/?serverVersion=
```
4. Generate auth certificates in order to sign JWT tokens:
```
openssl genrsa -out config/jwt/private.pem -aes256 4096
openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
```5. Configure parameters
__tea-rest/config/parameters.yml__
```yaml
parameters:
jwt_cert_private_path: config/jwt/private.pem
jwt_cert_public_path: config/jwt/public.pem
jwt_cert_secret: YOUR_CERTIFICATE_SECRET
```Thats all!
### How do I start the server?
You can use the project's console to perform that action:
```
bin/console server:run
```### where are the docs?
Since this is an open API, docs are accessed as API endpoints.
- As an OpenAPI JSON document under GET /api/doc.json
- As an HTML page under GET /api/docFor example, if you started the server using the project's console, the doc endpoints would be `http://127.0.0.1:8000/api/doc` and `http://127.0.0.1:8000/api/doc.json`.