mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Move API routing to Laravel (#10457)
* Add more api helper functions to centralize code more * Enable cors * Initial Legacy route in Laravel * Force api v0 responses to json Add a couple more routes * more paths, pretty print the json response pass parameters to the api function * devices basic functions * Port generic graph function check permissions function accepts callback to avoid lots of if statements * move vlans * links * graphs * fdb * health * wireless * port graphs * ip functions split em up * port_stack * components * compoment add/edit/delete * get_device_groups * port stats * port graphs * get_devices_by_group * port_groups * api_get_graph * show_endpoints * get_bill * get_bill_graph * get_bill_graphdata * get_bill_history * get_bill_history_graph * remaining bill functions * list_alerts * ack/unmute alert * Some cleanups * Some cleanups * list_alert_rules * alert rule add/edit/delete * inventory * list_cbgp * vrf * list_ipsec * list_fdb * list_links (fix both usages) * list_locations * list_locations * list_vlans * list_ip_addresses * list_arp * list_ip_networks * cleanup * services * list_logs and fix authlog....... * cleanup * cleanup 2 * remove slim * don't load schema more than once * basic test * fix style * downgrade laravel-cors to a version that supports PHP 7.1
This commit is contained in:
@@ -858,8 +858,10 @@ the standard options, all of which you can configure.
|
||||
|
||||
```php
|
||||
$config['api']['cors']['enabled'] = false;
|
||||
$config['api']['cors']['origin'] = '*';
|
||||
$config['api']['cors']['origin'] = ['*'];
|
||||
$config['api']['cors']['maxage'] = '86400';
|
||||
$config['api']['cors']['allowmethods'] = array('POST', 'GET', 'PUT', 'DELETE', 'PATCH');
|
||||
$config['api']['cors']['allowheaders'] = array('Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'X-Auth-Token');
|
||||
$config['api']['cors']['allowmethods'] = ['POST', 'GET', 'PUT', 'DELETE', 'PATCH'];
|
||||
$config['api']['cors']['allowheaders'] = ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'X-Auth-Token'];
|
||||
$config['api']['cors']['exposeheaders'] = ['Cache-Control', 'Content-Language', 'Content-Type', 'Expires', 'Last-Modified', 'Pragma'];
|
||||
$config['api']['cors']['allowcredentials'] = false;
|
||||
```
|
||||
|
Reference in New Issue
Block a user