This is a simple REST API. It is my solution to "Rest API task" from jobpal. The API handles request to a job offer database. Supported operations are:
- Insert a new job offer
- Update an existing job offer
- List all job offers
- List all job offers with pagination
- Retrieve locations and categories with most jobs
- Delete a job
- Download zip
- Unzip and move to directory
- Create a virtual environment and active it
python3 -m venv . && source bin/active
- Install necessary packages
pip install -r reqirements.txt
- Initialize dummy database
python init_db.py
- Start app
python app.py
It is recommended to use an API testing tool like Postman.
Send a POST request to localhost:5000/jobs
with the following json:
{
"title": "test_title",
"description": "test_description",
"company": "test_company",
"location": "test_location",
"category": "test_category"
}
Send a PUT request to localhost:5000/jobs/<ID_NUMBER>
with the following json:
{
"title": "updated_test",
"description": "updated_description",
"company": "updated_company",
"location": "updated_location",
"category": "updated_category"
}
Send a GET request to localhost:5000/jobs
to get all jobs.
Send a GET request to localhost:5000/jobs/page/<PAGE_NUMBER>
to get corresponding page number.
Send a GET request to localhost:5000/locations
to get locations.
Send a DELETE request to localhost:5000/jobs/<ID_NUMBER>
to delete job with corresponding ID number.