Restful Bible API built using Rust and DynamoDB.
Json files sourced from here
I prefer using local DynamoDB for testing purposes. To setup your local DynamoDB, follow the instructions
Create a .env in your project root and add endpoint for your Local DynamoDB
endpoint=http://localhost:9090/
Build the project
cargo buildThe api is designed for one table per translation.
To create the table
cargo run --bin create <translation_id>
# Creating for KJV
# cargo run --bin create kjvLoad the data
cargo run --bin load <translation_id> <file_path>
# Loading KJV
# cargo run --bin load bibles/kjv.jsoncargo run --bin bible_api# curl http://127.0.0.1:9000/search/<translation_id>/<book_id>/<chapter>
curl http://127.0.0.1:9000/search/asv/Gen/1[
{
"chapter": 1,
"verse": 1,
"text": "In the beginning God created the heavens and the earth.",
"translation_id": "ASV",
"book_id": "Gen",
"book_name": "Genesis"
},
{
"chapter": 1,
"verse": 2,
"text": "And the earth was waste and void; and darkness was upon the face of the deep: and the Spirit of God moved upon the face of the waters",
"translation_id": "ASV",
"book_id": "Gen",
"book_name": "Genesis"
},
{
"chapter": 1,
"verse": 3,
"text": "And God said, Let there be light: and there was light.",
"translation_id": "ASV",
"book_id": "Gen",
"book_name": "Genesis"
},
...
]# curl http://127.0.0.1:9000/search/<translation_id>/<book_id>/<chapter>?from=starting_verse_number
curl http://127.0.0.1:9000/search/asv/Gen/1?from=2# curl http://127.0.0.1:9000/search/<translation_id>/<book_id>/<chapter>?to=ending_verse_number
curl http://127.0.0.1:9000/search/asv/Gen/1?to=4# curl http://127.0.0.1:9000/search/<translation_id>/<book_id>/<chapter>?from=starting_verse_number&to=ending_verse_number
curl http://127.0.0.1:9000/search/asv/Gen/1?from=4&to=8