1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-14 22:22:39 +01:00
flox/flox-file-parser/app/index.js
Tim Meier 9d2362a178 Add File Parser
Add setup

More tests

Refactoring

Update readme

Update json format

Bump

Refactor

Add ext property for episodes

Update README.md

Add subtitles

Add code coverage

Add movies

Add tv and movie api request

Add env variables for root paths

Clean up

Merge all GET requests into one

Clean up
2017-02-13 21:17:25 +01:00

16 lines
344 B
JavaScript

const Parser = require("./lib/parser")
module.exports = (app) => {
app.get("/fetch/:type?", (req, res) => {
const parser = new Parser
const data = parser.fetch()
const allowedTypes = ["tv", "movies"]
if (allowedTypes.includes(req.params.type)) {
return res.send(data[req.params.type])
}
res.send(data)
})
}