https://github.com/adrian-lin-1-0-0/account-management-api
Homework
https://github.com/adrian-lin-1-0-0/account-management-api
Last synced: 3 months ago
JSON representation
Homework
- Host: GitHub
- URL: https://github.com/adrian-lin-1-0-0/account-management-api
- Owner: adrian-lin-1-0-0
- Created: 2024-06-10T08:54:44.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T09:38:53.000Z (12 months ago)
- Last Synced: 2025-01-25T18:43:41.707Z (4 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Account and Password Management API
## Description
This project provides two RESTful HTTP APIs for creating and verifying an account and password.
And uses sqlite3 as the database to store the account information.
- [API Documentation](./doc/api.yaml)
## Endpoints
### 1. Create Account
- **URL**: `/api/create_account`
- **Method**: `POST`
- **Input**: JSON payload with `username` and `password`
- **Output**: JSON payload with `success` and `reason`Example:
```sh
curl -X POST http://localhost:8000/api/create_account -H "Content-Type: application/json" -d '{"username":"testuser","password":"Password125"}'
```### 2. Verify Account and Password
- **URL**: `/api/verify_account`
- **Method**: `POST`
- **Input**: JSON payload with `username` and `password`
- **Output**: JSON payload with `success` and `reason`Example:
```sh
curl -X POST http://localhost:8000/api/verify_account -H "Content-Type: application/json" -d '{"username":"testuser","password":"Password125"}'
```## Running the Application with Docker
### Prerequisites
- Docker installed
### Steps
1. Pull the Docker image
```sh
docker pull adrianlin0/account-management-api:latest
```2. Run the Docker container
```sh
docker run -p 8000:8000 adrianlin0/account-management-api
```