https://github.com/ronik-v/questions_web_api
Rest api for receiving questions for the quiz
https://github.com/ronik-v/questions_web_api
api fastapi fastapi-api postgresql rest-api
Last synced: 12 months ago
JSON representation
Rest api for receiving questions for the quiz
- Host: GitHub
- URL: https://github.com/ronik-v/questions_web_api
- Owner: ronik-v
- License: apache-2.0
- Created: 2023-10-11T19:29:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-11T20:47:21.000Z (over 2 years ago)
- Last Synced: 2023-10-12T09:30:49.070Z (over 2 years ago)
- Topics: api, fastapi, fastapi-api, postgresql, rest-api
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# questions_web_api
## Used technology



## Orm
SQLAlchemy - 2.0.4
# Setup
-
First, copy the repository
Command:
git clone https://github.com/ronik-v/questions_web_api.git
-
Compiling the project (docker-compose)
Command:
docker-compose build
-
Create database and use script for create Question model
Database:
CREATE DATABASE question_quiz;
Run file: .\questions_web_api\data\database.py
-
Launch of the project
Command:
docker-compose up
-
Used libraries
File with libraries versions
# Use example
Submitting question records to the database
from requests import post
url = 'http://localhost:9000/questions_api
_json = {'questions_num': 100}
result = post(url, json=_json)
print(result.json())
This post request returns the last question added to the database, filtering out duplicates and at the same time saving as many queries as were specified in the post request in the 'questions_num' parameter
# License