Coder Social home page Coder Social logo

bibleapi / bibleapi-rest Goto Github PK

View Code? Open in Web Editor NEW
50.0 9.0 12.0 480 KB

Node.js based Bible API RESTful web service

Home Page: http://www.bibleapi.ws

License: MIT License

Shell 0.90% JavaScript 98.88% HTML 0.22%
bible asv kjv javascript api nodejs gulp

bibleapi-rest's Introduction

Bible API REST

Known Vulnerabilities

Bible API RESTful web service developed with Node.js


API

Single passage

Single verse

http://localhost:3333/api/Gen1:1

{
  verses: [
    {
      book: 1,
      chapter: 1,
      verse: 1,
      text: "In the beginning God created the heaven and the earth.",
      tran: "KJV",
      bookRef: "Gen",
      bookName: "Genesis"
    }
  ],
  text: "In the beginning God created the heaven and the earth."
}
Single chapter

http://localhost:3333/api/Gen1

Single passage range

Single verse range

http://localhost:3333/api/Gen1:1-5

Single chapter range

http://localhost:3333/api/Gen1-3

Single chapter and verses range

http://localhost:3333/api/Gen1:1-2:5

Multiple passages

http://localhost:3333/api/Gen1;Gen2:1-3:5

Supported translations

  • KJV
  • ASV

Single translation

http://localhost:3333/api/Gen1:1ASV

{
  verses: [
    {
      book: 1,
      chapter: 1,
      verse: 1,
      text: "In the beginning God created the heaven and the earth.",
      tran: "ASV",
      bookRef: "Gen",
      bookName: "Genesis"
    }
  ],
  text: "In the beginning God created the heaven and the earth."
}

Multiple translations

http://localhost:3333/api/Gen1:1KJV;ASV

{
  verses: [
    {
      book: 1,
      chapter: 1,
      verse: 1,
      text: "In the beginning God created the heaven and the earth.",
      tran: "KJV",
      bookRef: "Gen",
      bookName: "Genesis"
    },
    {
      book: 1,
      chapter: 1,
      verse: 1,
      text: "In the beginning God created the heavens and the earth.",
      tran: "ASV",
      bookRef: "Gen",
      bookName: "Genesis"
    }
  ]
}

Meta data

http://localhost:3333/api/meta/KJV

Development

Prerequisites

Setup

Database

Import JSON files from this repo: https://github.com/dev4christ/usfm2json/tree/master/json

KJV

mongoimport --db bibleapi --collection bible --type json --file kjv.json

ASV

mongoimport --db bibleapi --collection bible --type json --file asv.json

NPM Modules

npm install

Run

gulp

Test

mocha

Demo

bibleapi-rest's People

Contributors

rkazakov avatar romandueck avatar sharton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bibleapi-rest's Issues

Add ASV translation to the project

  1. Add ASV along with KJV translation to the project.
  2. Test if both translation work individually as well as within a single request.
  3. Develop unit tests

Fix verse range request when verses are in mixed order

Fix verse range request when verses are in mixed order. This is a really strange bug!

Run this request once:
http://localhost:4000/api/v1/Matt3:5-2
Response: verse 2

Run request again:
http://localhost:4000/api/v1/Matt3:5-2
Response: verse 5

I think the correct response in this case should be verse 5. So the logic is:
When the verse range is incorrect (first verse is bigger then the second) ignore the second and return just the first verse. So in the case about should be verse 5 only.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.