Skip to content

Commit

Permalink
Fix: typo in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jairojair committed Sep 23, 2018
1 parent b7d09de commit 599602e
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/api/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ print(response.json())
{"message": "Wrong credentials"}
```

!!! tip "Header authorization"
!!! tip "Authorization header"

Every new request you will made is necessary add this 'token' on authorization header.

Expand Down
Binary file removed docs/assets/images/example.png
Binary file not shown.
Binary file added docs/assets/images/example_feature_by_id.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/example_features.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

Feature flags / toggle give a software organization the power to reduce risk, iterate quicker, and gain more control. Feature flags allow you to decouple feature rollout from code deployment. This separation allows you unprecedented control of who sees what when, independent of release. And the “you” can be anyone in your organization – from developers, ops, designers, product managers, or marketers. Allowing control over a release unlocks the true power of your software.

![Example](assets/images/example.png)
![Example](assets/images/example_features.png)


The main goal for this project is create a simple and open source application for managing your features in production.
Expand Down
112 changes: 112 additions & 0 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
The Featuren is a software for you managing your features in production, this way..

## # Setup

### Create user

### login user

### Create two services

### Create feature



## # Use Featuren

Each service has a unique token, use this token to get the respective features.

![Example](assets/images/example_feature_by_id.png)

## Get feature by id

This request is very similiar to here, but now we will use <b>service token</b> for authorization.

<span class="resource"><span class="base get">GET</span> /features/{id}</span>

### Request

```http tab="HTTP"
GET /features/search-button HTTP/1.1
Authorization: Token _Ld_k_26y7H-Ar9og6cEz54rkNZEDkW1BIrkgSAFFg
```



```bash tab="Curl"
curl "http://0.0.0.0:8000/features/search-button" \
-H 'Authorization: Token _Ld_k_26y7H-Ar9og6cEz54rkNZEDkW1BIrkgSAFFg'
```

```python tab="Python"

# Install the Python Requests library:
# `pip install requests`

import requests

host = "http://0.0.0.0:8000"
token = "_Ld_k_26y7H-Ar9og6cEz54rkNZEDkW1BIrkgSAFFg"

headers = {"Authorization": f"Token {token}"}
response = requests.get(f"{host}/features/search-button", headers=headers)

print(response.json())


```

### Response
```json tab="200"
{"id":"search-button","version":"1.0.0"}
```

```json tab="400"
{"message":"Unauthorized, invalid token"}
```

```json tab="403"
{"message":"Access denied to resource"}
```


### Change feature availability

```http tab="HTTP"
POST /auth/login HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: 0.0.0.0:8000
Connection: close
{"username":"user","password":"secret"}
```



```bash tab="Curl"
curl -X "POST" "http://0.0.0.0:8000/auth/login" \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{
"username": "user",
"password": "secret"
}'
```

```python tab="Python"

# Install the Python Requests library:
# `pip install requests`

import requests

host = "http://0.0.0.0:8000"

user = {"username": "user", "password": "secret"}
response = requests.post(f"{host}/auth/login", user)

print(response.json())
```


3 changes: 0 additions & 3 deletions docs/use.md

This file was deleted.

2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ nav:
- Services: 'api/services.md'
- Features: 'api/features.md'

- Use case: 'use.md'
- Tutorial: 'tutorial.md'

dev_addr: '0.0.0.0:7000'

0 comments on commit 599602e

Please sign in to comment.