@canopycanopycanopy/b-ber-reader 1.2.12 → 1.2.13-react-reader.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{e79bfd88537def476913f3ed52f4f4b3.eot → 4674f8ded773cb03e824.eot} +0 -0
- package/dist/{a37b0c01c0baf1888ca812cc0508f6e2.ttf → 5e7382c63da0098d634a.ttf} +0 -0
- package/dist/{012cf6a10129e2275d79d6adac7f3b02.woff → 83bebaf37c09c7e1c3ee.woff} +0 -0
- package/dist/{570eb83859dc23dd0eec423a49e147fe.woff2 → cff684e59ffb052d72cb.woff2} +0 -0
- package/dist/index.html +22 -18
- package/dist/main.818ae91015d8d0fec8e2.js +29340 -0
- package/dist/main.818ae91015d8d0fec8e2.js.map +1 -0
- package/index.js +0 -1
- package/package.json +22 -85
- package/dist/2aaacec08d74ce95e948.css +0 -1
- package/dist/2aaacec08d74ce95e948.js +0 -52
- package/server.js +0 -46
package/server.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
Add compiled b-ber reader projects to an epub dir in b-ber-reader. These will be
|
|
4
|
-
served when running `npm start` from the b-ber-reader dir at
|
|
5
|
-
http://localhost:4000 or at the provided hostname and port
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const fs = require('fs')
|
|
10
|
-
const url = require('url')
|
|
11
|
-
const path = require('path')
|
|
12
|
-
const express = require('express') // eslint-disable-line import/no-extraneous-dependencies
|
|
13
|
-
|
|
14
|
-
const HOST = process.env.BBER_HOST || 'localhost'
|
|
15
|
-
const PORT = process.env.BBER_PORT || 4000
|
|
16
|
-
const BASE_DIR = 'epub'
|
|
17
|
-
const baseURL = `http://${HOST}:${PORT}/`
|
|
18
|
-
|
|
19
|
-
const router = express.Router()
|
|
20
|
-
const app = express()
|
|
21
|
-
|
|
22
|
-
let manifest
|
|
23
|
-
manifest = fs.readdirSync(`./${BASE_DIR}`).filter(a => /^\./.test(a) === false)
|
|
24
|
-
manifest = manifest.map(dir => ({
|
|
25
|
-
id: String(Math.random()).slice(2),
|
|
26
|
-
title: dir,
|
|
27
|
-
url: `${baseURL}${BASE_DIR}/${dir}`,
|
|
28
|
-
cover: url.resolve(
|
|
29
|
-
`${baseURL}${BASE_DIR}/${dir}/OPS/images/`,
|
|
30
|
-
fs
|
|
31
|
-
.readdirSync(`./${BASE_DIR}/${dir}/OPS/images`)
|
|
32
|
-
.find(img => /__bber_cover__/.test(img)) || ''
|
|
33
|
-
),
|
|
34
|
-
}))
|
|
35
|
-
|
|
36
|
-
const api = router.get('/books.json', (_, res) => res.json(manifest))
|
|
37
|
-
|
|
38
|
-
app.use(express.static('public'))
|
|
39
|
-
app.use(`/${BASE_DIR}`, express.static(path.join(__dirname, BASE_DIR)))
|
|
40
|
-
app.use('/api', api)
|
|
41
|
-
app.get('*', (_, res) =>
|
|
42
|
-
res.sendFile(path.join(__dirname, 'public', 'index.html'))
|
|
43
|
-
)
|
|
44
|
-
app.listen(PORT, '0.0.0.0')
|
|
45
|
-
|
|
46
|
-
console.log(`Listening on ${baseURL}`)
|