https://github.com/maximebourdel/bourses-api
API for a Symfony3 projects restituing a list of 16 000 stocks
https://github.com/maximebourdel/bourses-api
doctrine-orm symfony3
Last synced: 11 months ago
JSON representation
API for a Symfony3 projects restituing a list of 16 000 stocks
- Host: GitHub
- URL: https://github.com/maximebourdel/bourses-api
- Owner: maximebourdel
- License: mit
- Created: 2017-01-11T21:05:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-26T10:37:16.000Z (almost 9 years ago)
- Last Synced: 2025-02-02T01:28:49.396Z (about 1 year ago)
- Topics: doctrine-orm, symfony3
- Language: PHP
- Homepage: http://bourses-online.com
- Size: 64.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Bourses API
===================
----------
Installation
-------------
### Arborescence
L'arborescence doit être la suivante :
/var/www/html/bourses
: - api (repository bourses-api)
: - front-office (repository bourses-front-office)
### Clonage
Lancer la commande suivante :
```
$ git clone https://github.com/maximebourdel/bourses-api.git
```
### Fichier parameters.yml
Le fichier est à déposer dans /app/config fichier parameters.yml
```yml
# This file is auto-generated during the composer install
parameters:
database_host: 127.0.0.1
database_port: null
database_name: bourses
database_user: root
database_password: root
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
secret: ????????????????
cors_allow_origin: http://localhost
api_name: YahooFinanceAPI
api_description: Cette API permet d'interagir avec le Modèle des Bourses
```
### Installation de la base de données et des tables
```sh
$ cd /var/www/html/bourses/api
$ php bin/console doctrine:database:create
$ php bin/console doctrine:schema:update --force
```
### Import des librairies
La commande suivante va installer les librairies :
```
$ composer update
```
Vérification : la commande suivante ne doit pas retourner d'erreur
```
$ php bin/console
```
### Autoriser les accès depuis n'importe quel serveur
Dans le répertoire web pour le fichier app_dev.php :
Supprimer les lignes
```php
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']) || php_sapi_name() === 'cli-server')
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
```
### Configurer apache2
Dans le répertoire /etc/apache2 dans le fichier apache2.conf , et ajouter à la fin du fichier :
```
ServerName bourses-online.com
ServerAlias www.bourses-online.com
Alias /api /var/www/html/bourses/api/web
DocumentRoot /var/www/html/bourses/front-office/dist
AllowOverride None
Order Allow,Deny
Allow from All
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html
# to allow html5 state links
RewriteRule ^ index.html [L]
```
Redémarrer ensuite apache :
```
$ sudo service apache2 restart
```