Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bennihtm committed Jul 18, 2024
1 parent 892b44f commit 1ea38a8
Show file tree
Hide file tree
Showing 9 changed files with 601 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# bible-api
API for api.bible and OpenBibleProject
API proxy / caching server for api.bible and OpenBibleProject
1 change: 1 addition & 0 deletions api/abs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// fetch and handle bible from bible.api
2 changes: 2 additions & 0 deletions api/dailytexts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// fetch dailytexts
const availableData = "https://losungen.awesomebible.de/xml/available-data.json"
1 change: 1 addition & 0 deletions api/obp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// fetch and handle OpenBibleProject modules
14 changes: 14 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const express = require('express')
const app = express()
const port = 3000
const info = require('./info')

app.get('/', (req, res) => {
res.send('Hello World!')
})

app.use('/info', info)

app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})
25 changes: 25 additions & 0 deletions info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const express = require('express')
const router = express.Router()

// middleware that is specific to this router
const timeLog = (req, res, next) => {
console.log('Time: ', Date.now())
next()
}
router.use(timeLog)

// list all available bible translations (both obp modules and api.bible )
router.get('/', (req, res) => {
res.send('infodump')
})

// handle OpenBibleProject modules
router.get('/obp/', (req, res) => {
res.send('obp')
})

// handle
router.get('/abs/', (req, res) => {
res.send('api.bible')
})
module.exports = router
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "bible-api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Benjamin Hartmann",
"license": "MIT",
"dependencies": {
"express": "^4.19.2"
}
}
Loading

0 comments on commit 1ea38a8

Please sign in to comment.