mirror of
https://github.com/Casvt/MIND.git
synced 2026-04-25 03:00:20 -04:00
Doc update (#67)
* Updated README * Added EXPOSE to Dockerfile for Docker Desktop * Refactored docker compose file * Updated CONTRIBUTING * Docs update * Added docs for sending files * Added styling of scroll bar * Fixed various colors * Fixed Dockerfile exposed port * Updated api docs for merging * Attempt at fixing merge problems
This commit is contained in:
@@ -16,6 +16,8 @@ from frontend.api import (NotificationServiceNotFound, ReminderNotFound,
|
||||
from frontend.input_validation import DataSource, api_docs
|
||||
|
||||
api_prefix = SERVER.api_prefix
|
||||
admin_prefix = SERVER.admin_prefix
|
||||
api_file = folder_path('docs', 'other_docs', 'api.md')
|
||||
|
||||
url_var_map = {
|
||||
'int:n_id': NotificationServiceNotFound,
|
||||
@@ -54,9 +56,11 @@ curl -sSL 'http://192.168.2.15:8080{api_prefix}/reminders?api_key=ABCDEFG'
|
||||
|
||||
## Supplying data
|
||||
|
||||
Often, data needs to be supplied with a request.
|
||||
If the parameters need to be supplied via `url`, add them to the url as url parameters.
|
||||
If the parameters need to be supplied via `body`, add them to the body as a json object and supply the `Content-Type: application/json` header.
|
||||
Often, data needs to be supplied with a request:
|
||||
|
||||
- If the parameters need to be supplied via `url`, add them to the url as url parameters.
|
||||
- If the parameters need to be supplied via `body`, add them to the body as a json object and supply the `Content-Type: application/json` header.
|
||||
- If the parameters need to be supplied via `file`, send them as form data values and supply the `Content-Type: multipart/form-data` header.
|
||||
|
||||
For example:
|
||||
```bash
|
||||
@@ -68,6 +72,13 @@ curl -sSLX POST \\
|
||||
-H 'Content-Type: application/json' \\
|
||||
-d '{{"title": "Test service", "url": "test://fake/url"}}' \\
|
||||
'http://192.168.2.15:8080{api_prefix}/notificationservices?api_key=ABCDEFG'
|
||||
|
||||
# File parameter
|
||||
curl -sSLX POST \\
|
||||
-H 'Content-Type: multipart/form-data' \\
|
||||
-F file=@/backups/MIND_backup.db \\
|
||||
'http://192.168.2.15:8080{admin_prefix}/database?api_key=ABCDEFG'
|
||||
|
||||
```
|
||||
|
||||
## Endpoints
|
||||
@@ -133,18 +144,18 @@ Replace `<{url_var}>` with the ID of the entry. For example: `{rule.replace(f'<{
|
||||
|
||||
result += '\n'
|
||||
|
||||
with open(folder_path('docs', 'api.md'), 'r') as f:
|
||||
with open(api_file, 'r') as f:
|
||||
current_content = f.read()
|
||||
|
||||
if current_content == result:
|
||||
print('Nothing changed')
|
||||
else:
|
||||
with open(folder_path('docs', 'api.md'), 'w+') as f:
|
||||
with open(api_file, 'w+') as f:
|
||||
f.write(result)
|
||||
|
||||
run(["git", "config", "--global", "user.email", '"casvantijn@gmail.com"'])
|
||||
run(["git", "config", "--global", "user.name", '"CasVT"'])
|
||||
run(["git", "checkout", "Development"])
|
||||
run(["git", "add", folder_path('docs', 'api.md')])
|
||||
run(["git", "commit", "-m", "Updated API docs"])
|
||||
run(["git", "push"])
|
||||
# run(["git", "config", "--global", "user.email", '"casvantijn@gmail.com"'])
|
||||
# run(["git", "config", "--global", "user.name", '"CasVT"'])
|
||||
# run(["git", "checkout", "Development"])
|
||||
# run(["git", "add", api_file])
|
||||
# run(["git", "commit", "-m", "Updated API docs"])
|
||||
# run(["git", "push"])
|
||||
|
||||
Reference in New Issue
Block a user