mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Merge pull request #456 from robbiet480/master
Add CORS and /api/discovery_info docs
This commit is contained in:
commit
fa984d065b
@ -21,6 +21,9 @@ http:
|
|||||||
development: 1
|
development: 1
|
||||||
ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem
|
ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem
|
||||||
ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem
|
ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem
|
||||||
|
cors_allowed_origins:
|
||||||
|
- google.com
|
||||||
|
- home-assistant.io
|
||||||
```
|
```
|
||||||
|
|
||||||
Configuration variables:
|
Configuration variables:
|
||||||
@ -30,6 +33,8 @@ Configuration variables:
|
|||||||
- **development** (*Optional*): Disable caching and load unvulcanized assets. Useful for Frontend development.
|
- **development** (*Optional*): Disable caching and load unvulcanized assets. Useful for Frontend development.
|
||||||
- **ssl_certificate** (*Optional*): Path to your TLS/SSL certificate to serve Home Assistant over a secure connection.
|
- **ssl_certificate** (*Optional*): Path to your TLS/SSL certificate to serve Home Assistant over a secure connection.
|
||||||
- **ssl_key** (*Optional*): Path to your TLS/SSL key to serve Home Assistant over a secure connection.
|
- **ssl_key** (*Optional*): Path to your TLS/SSL key to serve Home Assistant over a secure connection.
|
||||||
|
- **cors_allowed_origins** (*Optional*): A list of origin domain names to allow [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) requests from. Enabling this will set the `Access-Control-Allow-Origin` header to the Origin header if it is found in the list, and the `Access-Control-Allow-Headers` to `Origin, Accept, X-Requested-With, Content-type, X-HA-access`.
|
||||||
|
|
||||||
|
|
||||||
The [Set up encryption using Let's Encrypt](/blog/2015/12/13/setup-encryption-using-lets-encrypt/) blog post gives you details about the encryption of your traffic using free certificates from [Let's Encrypt](https://letsencrypt.org/).
|
The [Set up encryption using Let's Encrypt](/blog/2015/12/13/setup-encryption-using-lets-encrypt/) blog post gives you details about the encryption of your traffic using free certificates from [Let's Encrypt](https://letsencrypt.org/).
|
||||||
|
|
||||||
|
@ -99,6 +99,24 @@ Sample `curl` command:
|
|||||||
$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/config
|
$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/config
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### {% linkable_title GET /api/discovery_info %}
|
||||||
|
Returns basic information about the Home Assistant instance as JSON.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"base_url": "http://127.0.0.1:8123",
|
||||||
|
"location_name": "Home",
|
||||||
|
"requires_api_password": true,
|
||||||
|
"version": "0.20.0.dev0"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Sample `curl` command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/discovery_info
|
||||||
|
```
|
||||||
|
|
||||||
#### {% linkable_title GET /api/bootstrap %}
|
#### {% linkable_title GET /api/bootstrap %}
|
||||||
Returns all data needed to bootstrap Home Assistant.
|
Returns all data needed to bootstrap Home Assistant.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user