This commit is contained in:
Marcel Pociot
2020-06-04 21:41:31 +02:00
parent df4005482c
commit f3d2b088da
26 changed files with 537 additions and 105 deletions

View File

@@ -1,8 +0,0 @@
---
title: Basic Authentication
order: 8
---
# Sharing local sites
This page will be under the "Basic Usage" submenu.

View File

@@ -0,0 +1,9 @@
---
title: Authorization
order: 1
---
# Authorization
The Expose server API uses the same authentication method as the expose admin interface itself.
So you can use any of the configured user/password combinations as basic authentication.

View File

@@ -1,8 +0,0 @@
---
title: Configuration
order: 1
---
# Sharing local sites
This page will be under the "Basic Usage" submenu.

View File

@@ -1,8 +0,0 @@
---
title: Dashboard
order: 5
---
# Sharing local sites
This page will be under the "Basic Usage" submenu.

View File

@@ -1,8 +0,0 @@
---
title: Extending
order: 10
---
# Sharing local sites
This page will be under the "Basic Usage" submenu.

56
docs/api/settings.md Normal file
View File

@@ -0,0 +1,56 @@
---
title: Settings
order: 2
---
# Settings
Expose provides two API endpoints that allow you to either read or update the currently active server settings.
## Reading the settings
To retrieve the currently active configuration, you can perform a GET request to the `/api/settings` endpoint:
The result looks like this:
```json
{
"configuration":{
"hostname": "expose.dev",
"port": 8080,
"database": "/home/forge/expose/database/expose.db",
"validate_auth_tokens": false,
"maximum_connection_length": 0,
"subdomain": "expose",
"subdomain_generator": "App\\Server\\SubdomainGenerator\\RandomSubdomainGenerator",
"users": {
"username":"password"
},
"user_repository": "App\\Server\\UserRepository\\DatabaseUserRepository",
"messages": {
"message_of_the_day":"Thank you for using expose.",
"invalid_auth_token":"Authentication failed. Please check your authentication token and try again.",
"subdomain_taken":"The chosen subdomain :subdomain is already taken. Please choose a different subdomain."
}
}
}
```
## Updating the settings
To update the currently active settings, send a POST requests to the `/api/settings` endpoint.
The endpoint expects you to send the following data:
```
validate_auth_tokens: BOOLEAN
maximum_connection_length: INTEGER
messages: ARRAY
messages.message_of_the_day: STRING
messages.invalid_auth_token: STRING
messages.subdomain_taken: STRING
```
You will receive a response containing the updated configuration as JSON.

View File

@@ -1,8 +0,0 @@
---
title: Sharing your local sites
order: 1
---
# Sharing local sites
This page will be under the "Basic Usage" submenu.

32
docs/api/sites.md Normal file
View File

@@ -0,0 +1,32 @@
---
title: Sites
order: 3
---
# Sites
Expose provides two API endpoints that allow you to either retrieve all currently shared sites, or disconnect a site with a given site ID.
## Retrieving all shared sites
To retrieve the currently shared sites, you can perform a GET request to the `/api/sites` endpoint:
The result looks like this:
```json
{
"sites":[
{
"id":10,
"host":"beyondco.de.test",
"client_id":"5ed94b485e2f6",
"subdomain":"beyondcode",
"shared_at":"2020-06-04 19:28:08"
}
]
}
```
## Disconnecting a shared site
To disconnect a shared site from your server, you can perform a DELETE request to the `/api/sites/{site_id}` endpoint.

72
docs/api/users.md Normal file
View File

@@ -0,0 +1,72 @@
---
title: Users
order: 4
---
# Users
Expose provides three API endpoints that allow you to either retrieve all registered users, create a new user, or delete an existing user from the expose server.
## Retrieving all users
To retrieve the users, you can perform a GET request to the `/api/users` endpoint:
The result looks like this:
```json
{
"users":[
{
"id":9,
"name":"miguel",
"auth_token":"858fad3d-2163-4af6-8c8d-68e89f80cf8c",
"created_at":"2020-06-04 19:31:26",
"updated_at":null
},
{
"id":8,
"name":"sebastian",
"auth_token":"360461ea-23b9-422e-bc76-7ca1b2ec8a91",
"created_at":"2020-06-04 19:31:17",
"updated_at":null
},
{
"id":7,
"name":"marcel",
"auth_token":"b5f3ee57-1e77-4a94-8b7f-da13e3dc6478",
"created_at":"2020-06-04 19:31:16",
"updated_at":null
}
]
}
```
## Creating a new user
To create a new user on the expose server, you can perform a POST request to the `/api/users` endpoint.
The endpoint expects you to send the following data:
```json
name: STRING
```
This will return a response containing the generated user:
```json
{
"user": {
"id":8,
"name":"sebastian",
"auth_token":"360461ea-23b9-422e-bc76-7ca1b2ec8a91",
"created_at":"2020-06-04 19:31:17",
"updated_at":null
}
}
```
## Deleting a user
To delete a user on the expose server, you can perform a DELETE request to the `/api/users/{user_id}` endpoint.
> **Note:** The users currently active shared sites will not be disconnected automatically.